Jump to content
Sign in to follow this  
uncookedzebra

MPRespawn eventhandler and setPosATL trouble

Recommended Posts

Hey guys I am having trouble with my MpRespawn eventhandler. I wish to respawn the units in the air but I have not had any luck. i am using markers for respawn. I tryed using OnPlayerRespawn.sqf and using

player setPosATL [(getPosATL player) select 0, (getPosATL player) select 1, ((getPosATL player) select 2) + 300];

I also tryed in initPlayerLocal.sqf

player addMPEventhandler ["MPRespawn",{player setPosATL [(getPosATL player) select 0, (getPosATL player) select 1, ((getPosATL player) select 2) + 300];player addbackpack "B_Parachute"; player linkitem "ItemMap";}];

anybody have any insights?

Share this post


Link to post
Share on other sites

You don't need MPRespawn here, simply add normal Respawn event handler for each player so they will handle themselves.

init.sqf:

true spawn {
   //Wait until player is initialized
   waitUntil {player == player};

   player addEventHandler ["Respawn", {
       //Get dead body pos
       _pos = getPosATL (_this select 1);
       _pos set [2, (_pos select 2) + 200];

       //Set new unit pos
       (_this select 0) setPosATL _pos;
   }];
};

Edited by SaMatra

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  

×