Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (GUI::Option("Spawn Bodyguard", ""))
- {
- int clone[1000];
- int gcount = 1;
- Ped SelectedPlayer = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(Features::SelectedPlayer); // The player to spawn it for
- if (!ENTITY::DOES_ENTITY_EXIST(SelectedPlayer)) return; // Making sure the player exists
- Hash railgun = MISC::GET_HASH_KEY("WEAPON_RAILGUN"); // The bodyguards weapon
- Vector3 pos = ENTITY::GET_ENTITY_COORDS(SelectedPlayer, false); // Players position to spawn it on
- Hash pedm = MISC::GET_HASH_KEY("u_m_m_jesus_01"); // The bodyguards ped
- STREAMING::REQUEST_MODEL(pedm); // Request the ped
- while (!STREAMING::HAS_MODEL_LOADED(pedm)) { fibermain::pause(); } // Wait for the ped to load
- int my_group = PLAYER::GET_PLAYER_GROUP(SelectedPlayer); // Create a group for the bodyguards
- clone[gcount] = PED::CREATE_PED(26, pedm, pos.x + rand() % 1, pos.y + rand() % 1, pos.z + 1, 0, 1, 1); // Create the ped
- PED::SET_PED_AS_GROUP_LEADER(SelectedPlayer, my_group); // Set ped as group leader
- PED::SET_PED_AS_GROUP_MEMBER(clone[gcount], my_group); // Add it as a member
- PED::SET_PED_NEVER_LEAVES_GROUP(clone[gcount], my_group); // Make it so it cant leave
- ENTITY::SET_ENTITY_INVINCIBLE(clone[gcount], false); // Godmode?
- PED::SET_PED_COMBAT_ABILITY(clone[gcount], 100); // How good are they at shooting?
- WEAPON::GIVE_WEAPON_TO_PED(clone[gcount], railgun, railgun, 9999, 9999); // Give them the gun you selected
- PED::SET_PED_CAN_SWITCH_WEAPON(clone[gcount], true); // Can they switch to a sidearm?
- PED::SET_GROUP_FORMATION(my_group, 3); // Set the entire groups formation, you can change this anytime if you save my_group as a variable elsewhere
- PED::SET_PED_MAX_HEALTH(clone[gcount], 5000); // Set peds health (Not sure why, if its godmode, unless you disable godmode)
- gcount++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement