Jump to content
Sign in to follow this  
1para{god-father}

Waituntill and Player

Recommended Posts

I need to activate something when a player gets close just checking if this will work. will PLAYER be anyone who is playing ?

waituntil {player distance _vip1 < 20};

Share this post


Link to post
Share on other sites

Player is always local to itself.

This hint will be shown for each player, once he is inside that 20m. So each player will get the hint at a different time:

waituntil {player distance _vip1 < 20};
hint "hello";

This method would show the hint for all players at the same time, once the leader is inside the 20m:

waituntil {(leader (group player)) distance _vip1 < 20};
hint "hello";

For multiplayer you should use the second one (or something similar), because it will activate for all players (clients) at the same time.

Depends on the purpose of cause. Hope that helps a bit.

Share this post


Link to post
Share on other sites

Thanks,

Basically I just need it to activate once any member of the team are within distance, it is a bomb that will go off, but i do not want 25 bombs !

Would this work then ?

if (isServer) then {
_grpdummy = createGroup EAST; 
_vip1 = _grpdummy createUnit ["RU_Functionary1", getMarkerPos "task6spawn", [], 10, ""];
removeAllWeapons _vip1;
_vip1 setCaptive true; 
_vip1 setBehaviour "CARELESS";
_vip1 setPos ((position _vip1 nearestObject 115676) buildingPos 14);
_vip1 switchMove "AmovPercMstpSsurWnonDnon";
waituntil {player distance _vip1 < 20};
sleep .5;
 	[nil, nil, rHINT, "HAHAHA you will not take me alive I have triggered the device you have 15 sec."] call RE;
	 sleep 15;
 _boom = "Bo_GBU12_LGB" createVehicle ((position _vip1 nearestObject 115676) buildingPos 14);
["Task6","succeeded"] call SHK_Taskmaster_upd;
};

Share this post


Link to post
Share on other sites

This works only if the player is the local server. If u run this script on a dedicated server it doesn't work.

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  

×