Jump to content
Sign in to follow this  
malakdecaen

Spawn a AI when a player die in MP??

Recommended Posts

Hi everybody ,

I want to know if is possible to spawn a AI when a player die ?

and if is possible to spawn the AI but with the same gear and the same position ?

exemple :

I die with a m16 and a backpack , i want the AI spawn with the same gear at the same position after 5 minutes .

It is possible to do that ?

and how can i do that please ?

Thanks a lot .

Share this post


Link to post
Share on other sites

First, you need to determine if the player is dead, then execute the spawning function. You could use these:

http://community.bistudio.com/wiki/addEventHandler

http://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Killed

http://community.bistudio.com/wiki/createUnit

This is an example:

player addEventHandler ["killed", {
   0 = _this spawn {
       _spawnPos = getPosATL (_this select 0);
       sleep (5 * 60);
       "o_soldier_f" createUnit [_spawnPos, (createGroup east)];
   };
}];

The eventHandler will execute locally and 'createUnit' has global effect, so only one AI will spawn and all clients will see it. You would also need some function to save the player's loadout to give the AI. I recommend a forum/google search for that.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×