Forum: GTA IV Mod Releases / W.I.P.s


The above video goes away if you are a member and logged in, so log in now!




 
Would you like to get all the new info from
PSX-Scene in your email each day?




Want to learn more about the team keeping you up to date with the latest scene news?

Read about them now!

Check out our Developer bios, too!

 


User Tag List

Like Tree8Likes

Thread: [REL] Colt's Build-A-Guard BETA
  

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
  1. #1 [REL] Colt's Build-A-Guard BETA 
    Colt's Avatar
    Colt is online now Developer
    Join Date
    Jun 2012
    Posts
    743
    Downloads
    0
    Uploads
    0
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    741
    Likes Received
    228
    So, because I haven't really done anything for the community for a while (Bad colt ) I thought I'd make a little something that people can hopefully use.

    As the title says, this is (supposed) to be used to make your own set of bodyguards, with whatever ped models, weapons, and names you want. Fully customizable!

    Also, this is just a BETA, so there may be some errors somewhere. Please feel free to correct them (if you can) or let me know where it is wrong and I'll try and correct them.

    Code:
    Code:
    //Made by Colt from www.psx-scene.com and NOT to be re-released anywhere else :)
    
    Ped gameped;
    float BGx,BGy,BGz;
    Group Bgroup;
    bool bg=0;
    int guard=0;
    
    void Print(char *string){
    		PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING", string, 5000, 1);
    	}
    
    	void GroupSettings(void){
    		if(bg==0){
    			GET_PLAYER_GROUP(GetPlayerIndex(), &Bgroup);
    			if(!DOES_GROUP_EXIST(Bgroup)){
    				CREATE_GROUP(0, Bgroup, true);
    				SET_GROUP_LEADER(Bgroup, GetPlayerPed());
    				SET_GROUP_SEPERATION_RANGE(Bgroup, 9999.9);
    				SET_GROUP_FORMATION(Bgroup, 2);
    				bg=1;
    			}
    		}
    	}
    
    	void Setup(uint model, char *name, uint weapon, float offset_y, uint Rcol, uint Gcol, uint Bcol){
    		REQUEST_MODEL(model);
    		while(!HAS_MODEL_LOADED(model)) WAIT(0);
    
    		Ped Pped = GetPlayerPed();
    
    		GET_OFFSET_FROM_CHAR_IN_WORLD_COORDS(Pped, 0, offset_y, 0, &BGx, &BGy, &BGz); //Finds your coords
    		CREATE_CHAR(26, model, BGx, BGy, BGz, &gameped, true); //Creates the bodyguard
    
    		SET_GROUP_MEMBER(Bgroup, gameped);
    		SET_CHAR_NEVER_LEAVES_GROUP(gameped, true);
    
    		SET_CHAR_ACCURACY(gameped, 100); //Accuracy of the bodyguard
    		SET_CHAR_SHOOT_RATE(gameped, 100); //Speed the bodyguard fires
    		SET_CHAR_WILL_DO_DRIVEBYS(gameped, true); //Sets the bodyguard to shoot from a passenger seat
    		SET_CHAR_SIGNAL_AFTER_KILL(gameped, true); //Tells you when someone is dead?
    		SET_CHAR_WILL_USE_CARS_IN_COMBAT(gameped, true); //Sets the bodyguard to use cars?
    		SET_CHAR_WILL_FLY_THROUGH_WINDSCREEN(gameped, false); //Sets the bodyguard to stay in the vehicle after collosion
    		SET_CHAR_INVINCIBLE(gameped, false); //sets bodyguard to godmode or not
    		SET_CHAR_PROVIDE_COVERING_FIRE(gameped, true); //Provides covering fire?
    		SET_CHAR_CANT_BE_DRAGGED_OUT(gameped, true); //Sets boduguard to not be dragged from a vehicle
    		SET_CHAR_STAY_IN_CAR_WHEN_JACKED(gameped, true); //Sets bodyguard not to be jacked from a vehicle
    		SET_PED_DONT_DO_EVASIVE_DIVES(gameped, false); //Sets bodyguard to roll, wallhug (Not proper term, but my term lol) etc.
    		SET_PED_PATH_MAY_DROP_FROM_HEIGHT(gameped, true); //Ped follows you from drops
    		SET_PED_PATH_MAY_USE_CLIMBOVERS(gameped, true); //Ped follows you and climbs over things
    		SET_PED_PATH_MAY_USE_LADDERS(gameped, true); //Ped climbs ladders
    
    		UpdateWeaponOfPed(gameped, weapon);
    		SET_CURRENT_CHAR_WEAPON(gameped, weapon, true);
    	}
    
    	void GuardGroup(void){
    		GET_GROUP_SIZE(Group group, uint *pStartIndex, uint *pCount);
    		uint amount, pCount;
    		GET_GROUP_SIZE(Bgroup, *amount, &pCount);
    		if (pCount < 10){
    			if(guard==0){
    				BGuard(MODEL_IG_WhateverModel,"WhateverName",WEAPON_WhateverWeapon, 2, 226, 65, 215); //Guard 1
    				guard=1;
    			}
    			else if(guard==1){
    				BGuard(MODEL_IG_WhateverModel,"WhateverName",WEAPON_WhateverWeapon, 2, 226, 65, 215); //Guard 2
    				guard=2;
    			}
    			Print("Whatever you want it to say on the screen when spawned", 5000, 1); //What it says when you spawn the guards
    		}
    	}
    
    	void Main(void){
    		THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
    		while(1){
    			GuardGroup();
    			GroupSettings();
    			WAIT (0);
    		}
    	}
    I've tried to make it as simple as possible to read and understand what each function you can change does.

    Please use this responsibly!
    This is for learning purposes and NOT to be abused!

    List Of Ped Models

    List Of Weapon Models

    Change log:
    Updated code, made it easier to read and cleaned up code also.

    Colt.
    Last edited by Colt; 10-31-2012 at 05:41 PM. Reason: Fixed errors
    Mod Videos: http://www.youtube.com/DontGetAngryBro
    Reply With Quote  

  2. #2  
    nativesith's Avatar
    nativesith is offline Moderator
    Join Date
    Jun 2011
    Location
    Los Santos
    Posts
    1,363
    Downloads
    12
    Uploads
    7
    Mentioned
    37 Post(s)
    Tagged
    1 Thread(s)
    Likes Given
    962
    Likes Received
    648
    Nice ...love da labelin.
    Hopfully this will make it clearer fo some (like Iself ).
    Colt likes this.
    Reply With Quote  

  3. #3  
    Colt's Avatar
    Colt is online now Developer
    Join Date
    Jun 2012
    Posts
    743
    Downloads
    0
    Uploads
    0
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    741
    Likes Received
    228
    Quote Originally Posted by nativesith View Post
    Nice ...love da labelin.
    Hopfully this will make it clearer fo some (like Iself ).
    Thanks and hopefully so, that's my goal at least.
    Last edited by Colt; 10-31-2012 at 01:19 PM.
    Mod Videos: http://www.youtube.com/DontGetAngryBro
    Reply With Quote  

  4. #4  
    keredor's Avatar
    keredor is offline Developer
    Join Date
    Mar 2012
    Posts
    180
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    136
    Likes Received
    123
    one small problem. have a look at the print function.

    EDIT: also there is no main.
    Reply With Quote  

  5. #5  
    Colt's Avatar
    Colt is online now Developer
    Join Date
    Jun 2012
    Posts
    743
    Downloads
    0
    Uploads
    0
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    741
    Likes Received
    228
    Thanks.

    And as for the main, I could put one in but... I'd have thought if people could understand that, they could make a main as they could be trying to put it into a menu which could just cause problems.
    Mod Videos: http://www.youtube.com/DontGetAngryBro
    Reply With Quote  

  6. #6  
    keredor's Avatar
    keredor is offline Developer
    Join Date
    Mar 2012
    Posts
    180
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    136
    Likes Received
    123
    well you do have 90% of the main function, its just missing a part lol
    Reply With Quote  

  7. #7  
    Colt's Avatar
    Colt is online now Developer
    Join Date
    Jun 2012
    Posts
    743
    Downloads
    0
    Uploads
    0
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    741
    Likes Received
    228
    I know lol but I code funny sometimes.

    Give me a few I'll correct it
    Mod Videos: http://www.youtube.com/DontGetAngryBro
    Reply With Quote  

  8. #8  
    Colt's Avatar
    Colt is online now Developer
    Join Date
    Jun 2012
    Posts
    743
    Downloads
    0
    Uploads
    0
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    741
    Likes Received
    228
    Fixed (I think).

    Finished the main (lol), corrected the Print Function (Again, I think)
    Mod Videos: http://www.youtube.com/DontGetAngryBro
    Reply With Quote  

  9. #9  
    keredor's Avatar
    keredor is offline Developer
    Join Date
    Mar 2012
    Posts
    180
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    136
    Likes Received
    123
    Yeah they are both sweet now, good job. 1 onther piece of advice.. instead of

    PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING", "Whatever you want it to say on the screen when spawned", 5000, 1); //What it says when you spawn the guards

    just use

    PrintFunction("Whatever you want it to say on the screen when spawned");


    That's the point of it, it saves typing the native every time.
    Colt likes this.
    Reply With Quote  

  10. #10  
    Colt's Avatar
    Colt is online now Developer
    Join Date
    Jun 2012
    Posts
    743
    Downloads
    0
    Uploads
    0
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    741
    Likes Received
    228
    Oh it does? I thought it did another job.

    Well thanks for telling me, that's a lot easier now
    Mod Videos: http://www.youtube.com/DontGetAngryBro
    Reply With Quote  

Page 1 of 2 1 2 LastLast
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •