Jump to content

Recommended Posts

Hi we run this script in a dedi and when you die you cannot call on place object script anymore, I know you need eventhandlers but I really do not know anything about them, could use some help. I read a lot about them but still dont understand much

waituntil {!isNull player};

if (player in [delta_1,delta_2,delta_3,delta_4]) then {

actPlaceObject = player addAction ["Place Blast Wall","placeobj.sqf", player,-1,false];

};

---------- Post added at 07:33 AM ---------- Previous post was at 06:42 AM ----------

I found it, I put this after that above line

if ( isNil{player getVariable "mk_killedEHadded"} ) then 
{
player addEventHandler ["killed", 
{ 
	[] spawn {
		waitUntil { alive player }; 
		actPlaceObject = player addAction ["Place Blast Wall","placeobj.sqf", player,-1,false];
	};	
}];
player setVariable ["mk_killedEHadded", true];
};

---------- Post added at 08:56 AM ---------- Previous post was at 07:33 AM ----------

How do you put UAV and have it so your if you player dies then they will resync to the uav module so they can command it again?

Also how do you get your OA backpack to save, the contents in it. When we use it the items inside are gone and you cannot open the bag

---------- Post added at 09:26 AM ---------- Previous post was at 08:56 AM ----------

Ok I have a new problem, if say one unit who should not be able to run this script dies they can run it after they respawn, How can I get it so only the select ones can use it?

if ( isNil{player getVariable "mk_killedEHadded"} ) then 
{
player addEventHandler ["killed", 
{ 
	[] spawn {
		waitUntil { alive player }; 
		actPlaceObject = player addAction ["Place Blast Wall","placeobj.sqf", player,-1,false];
	};	
}];
player setVariable ["mk_killedEHadded", true];
};

Share this post


Link to post
Share on other sites

make a global array with allowed units, place it in init.sqf

allowed = [delta_1,delta_2,delta_3,delta_4];

now you change if (player in [delta_1,delta_2,delta_3,delta_4]) then {

to if (player in allowed) then {

now in the killed eventhandler use this:

waitUntil { alive player };

if (player in allowed) then {actPlaceObject = player addAction ["Place Blast Wall","placeobj.sqf", player,-1,false]};

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  

×