Jump to content

[V|REL] Spawn Random Bodyguard


Recommended Posts

 

 

 

 

Does it spawn different models of npcs depending on where your character is at?

 

Yea, that's how it seems.

 

Yes It will spawn the most common ped where you are like soldiers at the base ect GX4Bdmt.jpg?1db4djTt.jpg?1

 

Hey

 

How did you manage to spawn this is the game (the heist vehicle) could you let me know what mod please?

 

Pretty sure I saw it in Native Trainer, could be wrong.

 

Okay, i see it now thanks didnt realise the trainer had 30+ pages of vehicles XD

vithepunisher

Hey this is pretty awesome but just curious can you dismiss the bodyguards or delete them? its an awesome mod but it would be great to dismiss them. ps do they stay in game permanitely say if they die do the bodys stay there forever? :/ please keep working on this mod as its the most mod iv been looking forward to.. :):^:

 

Does it spawn different models of npcs depending on where your character is at?

 

Yea, that's how it seems.

 

Damn...

 

Tried to spawn some cop-bodyguards by walking into a policestation.

 

Did not work... Guess I'm a bit too close to actual peds :(

OrangeAgent

Nice!!! :panic:

 

But I found that, when the bodyguards die, their corpses never disappear. Even if you travel to the other side of the map and come back they are still there.

 

What I do is reload my last save every time a bunch of them die.

Update coming which will fix relationship groups.

Ex: Army bodyguards not shooting cops.

Nice mod Josh920 !

You should use native "SET_PED_AS_NO_LONGER_NEEDED" as this will remove the bodyguards corpses.

  • Like 1

I managed to piece together this code, and I've got a working "Brad Lives!" mod (basically a Brad spawner, who serves as a bodyguard). Is this similar to the way your mod is coded?

#include "script.h"bool ifPressed = false;bool ifPressed2 = false;bool getKeyPressed(int key) {	return (GetAsyncKeyState(key) & 0xFFFF) == 0x8001;}void main() {	Ped playerPed = PLAYER::PLAYER_PED_ID();	BOOL playerExists = ENTITY::DOES_ENTITY_EXIST(playerPed);	Vector3 playerPosition = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);	Any spawnID = GAMEPLAY::GET_HASH_KEY("CS_Stretch");	Any spawnID2 = GAMEPLAY::GET_HASH_KEY("CS_LesterCrest");	Any spawnID3 = GAMEPLAY::GET_HASH_KEY("CS_Brad");	Any spawnID4 = GAMEPLAY::GET_HASH_KEY("CS_LamarDavis");	//Any spawnID = GAMEPLAY::GET_HASH_KEY("CS_Brad");	//Any johnnyID = GAMEPLAY::GET_HASH_KEY("CS_JohnnyKlebitz");	//Any spawnID = GAMEPLAY::GET_HASH_KEY("u_m_y_zombie_01"); //zombie instead	Any weaponID = GAMEPLAY::GET_HASH_KEY("WEAPON_MICROSMG");	Any weaponID2 = GAMEPLAY::GET_HASH_KEY("WEAPON_COMBATPISTOL");	STREAMING::REQUEST_MODEL(spawnID);	STREAMING::REQUEST_MODEL(spawnID2);	STREAMING::REQUEST_MODEL(spawnID3);	STREAMING::REQUEST_MODEL(spawnID4);	while (true)	{		ifPressed = getKeyPressed(0x42);		if (ifPressed)		{			playerPosition = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);			Ped ped = PED::CREATE_PED(1, spawnID, playerPosition.x, playerPosition.y, playerPosition.z, 0, true, true);			Ped ped2 = PED::CREATE_PED(1, spawnID2, playerPosition.x, playerPosition.y, playerPosition.z, 0, true, true);			Ped ped3 = PED::CREATE_PED(1, spawnID3, playerPosition.x, playerPosition.y, playerPosition.z, 0, true, true);			Ped ped4 = PED::CREATE_PED(1, spawnID4, playerPosition.x, playerPosition.y, playerPosition.z, 0, true, true);			//Ped ped = PED::CREATE_RANDOM_PED(playerPosition.x, playerPosition.y, playerPosition.z); //for random ped instead			int group = PLAYER::GET_PLAYER_GROUP(PLAYER::PLAYER_PED_ID());			PED::SET_PED_AS_GROUP_MEMBER(ped, group);			PED::SET_PED_AS_GROUP_MEMBER(ped2, group);			PED::SET_PED_AS_GROUP_MEMBER(ped3, group);			PED::SET_PED_AS_GROUP_MEMBER(ped4, group);			AI::TASK_COMBAT_HATED_TARGETS_AROUND_PED(ped, 5000, 0);			AI::TASK_COMBAT_HATED_TARGETS_AROUND_PED(ped2, 5000, 0);			AI::TASK_COMBAT_HATED_TARGETS_AROUND_PED(ped3, 5000, 0);			AI::TASK_COMBAT_HATED_TARGETS_AROUND_PED(ped4, 5000, 0);			WEAPON::GIVE_DELAYED_WEAPON_TO_PED(ped, weaponID, 5, true);			WEAPON::GIVE_DELAYED_WEAPON_TO_PED(ped2, weaponID2, 5, true);			WEAPON::GIVE_DELAYED_WEAPON_TO_PED(ped3, weaponID, 5, true);			WEAPON::GIVE_DELAYED_WEAPON_TO_PED(ped4, weaponID, 5, true);			//ENTITY::SET_ENTITY_INVINCIBLE(ped, false); //for invincible option			PED::SET_PED_KEEP_TASK(ped, true);			PED::SET_PED_GENERATES_DEAD_BODY_EVENTS(ped, true);			PED::SET_PED_KEEP_TASK(ped2, true);			PED::SET_PED_GENERATES_DEAD_BODY_EVENTS(ped2, true);			PED::SET_PED_KEEP_TASK(ped3, true);			PED::SET_PED_GENERATES_DEAD_BODY_EVENTS(ped3, true);			PED::SET_PED_KEEP_TASK(ped4, true);			PED::SET_PED_GENERATES_DEAD_BODY_EVENTS(ped4, true);		}		WAIT(0);	}}void ScriptMain() {	main();}

 

EDIT: I've reposted my code with the newest changes, as I contest the accusation that it's not my code. I got ideas from this thread on what functions to use, and I've done thorough research through a good few sources on how to use said functions, and I've written this code myself.

 

 

I wrote that myself.

 

 

I got ideas from this thread about what functions to use, but I didn't use anyone else's code.

Edited by TJGM
  • Like 2

Can you please make the AI bodyguard more intelligent and with different option of weapony on its inventory?

I want to have the professionals (Gang) as my bodyguads. The same goes to the Khangpae, Rednecks, O'neils, Soldiers, Police, Altruists, Hipsters, Marabunta, Vagos, Aztecas, Madrazo Cartel, Bonelli Family, Triads and The LOST MC.

It would be f*cking awsome if you could program the FIB, the IAA and the SWAT team as gang bodyguards.

 

One more thing.

 

I want bodyguards to be more intelligent when mounting the Machine Gun when using the Karin Technical. The same goes for the Insurgent.

 

They just shoot one bullet at time, not a storm of bullets. :c.

Acekiller.45

I have a really hard time spawning just one at a time. I tap the end key as fast as I can, and sometimes I spawn 5 or 6 just from that. Can we at least get a way to dismiss them or kill them?

Yeah just shoot by them with a rocket launcher or railgun

jedijosh920

I have a really hard time spawning just one at a time. I tap the end key as fast as I can, and sometimes I spawn 5 or 6 just from that. Can we at least get a way to dismiss them or kill them?

 

I will fix that in the next version or so.

 

I have a really hard time spawning just one at a time. I tap the end key as fast as I can, and sometimes I spawn 5 or 6 just from that. Can we at least get a way to dismiss them or kill them?

 

I will fix that in the next version or so.

 

Hi Jed, do you think you could make a K9 bodyguard script?

  • Like 2
jedijosh920

 

 

I have a really hard time spawning just one at a time. I tap the end key as fast as I can, and sometimes I spawn 5 or 6 just from that. Can we at least get a way to dismiss them or kill them?

 

I will fix that in the next version or so.

 

Hi Jed, do you think you could make a K9 bodyguard script?

 

 

Sure, I take requests, just add me on Skype: jedijosh920

:D

 

 

 

I have a really hard time spawning just one at a time. I tap the end key as fast as I can, and sometimes I spawn 5 or 6 just from that. Can we at least get a way to dismiss them or kill them?

 

I will fix that in the next version or so.

 

Hi Jed, do you think you could make a K9 bodyguard script?

 

 

Sure, I take requests, just add me on Skype: jedijosh920

:D

 

Awesome! I just sent a request. This script would go nicely if and when LSPDFR comes out.

vithepunisher

 

 

 

I have a really hard time spawning just one at a time. I tap the end key as fast as I can, and sometimes I spawn 5 or 6 just from that. Can we at least get a way to dismiss them or kill them?

 

I will fix that in the next version or so.

 

Hi Jed, do you think you could make a K9 bodyguard script?

 

 

Sure, I take requests, just add me on Skype: jedijosh920

:D

 

Can you please fix the bodygaurds not dissapearing when they die and include a delete bodyguard option.

I've made an upgraded version of this that spawns variations of the player character and only spawns 1 per key press, they have a rifle and pistol and will switch to pistol fire when in a vehicle but keep rifles equipped outside of vehicles :)

will release tonight, just polishing up some stuff first :D

Edited by kamaitachi
  • Like 1
vithepunisher

I've made an upgraded version of this that spawns variations of the player character and only spawns 1 per key press, they have a rifle and pistol and will switch to pistol fire when in a vehicle but keep rifles equipped outside of vehicles :)

 

will release tonight, just polishing up some stuff first :D

You sir are Awesome!! :) have a cookie :cookie:

facepoppies

 

I have a really hard time spawning just one at a time. I tap the end key as fast as I can, and sometimes I spawn 5 or 6 just from that. Can we at least get a way to dismiss them or kill them?

 

I will fix that in the next version or so.

 

 

Awesome! I really appreciate it. This is still my favorite version of the mod over those swat and mercenary ones. I know how weird this sounds, but I like to spawn a girl to be my body guard and then I try really hard to keep her alive.

  • Like 1
jedijosh920

I like this mod but will there be a time where you can change the weapons of your bodyguards, because there are so many weapons and its a shame if its only just a pistol for the guard?

 

Future updates will allow for change of weapons.

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.