Code:
Ped gameped;
float BGx,BGy,BGz;
Group Bgroup;
bool bg=0;
int guard=0;
void PrintFunction(void){
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_M_Y_RUNNER,"Runner",WEAPON_MICRO_UZI, 2, 226, 65, 215); //Guard 1
guard=1;
}
else if(guard==1){
BGuard(MODEL_M_Y_RUNNER,"Runner",WEAPON_MICRO_UZI, 2, 226, 65, 215); //Guard 2
guard=2;
}
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
}
}
THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
while(1){
GuardGroup();
GroupSettings();
WAIT (0);
}
}
That could work.