Jump to content
Sign in to follow this  
Eargasm

Need help modifying a script

Recommended Posts

I need to modify this script to that there has to be at least four blufor players online for the script to activate or continue.

If someone can help me with this that would be awesome!

_art = (_this select 3) select 0;
if(cracking)exitwith{player groupchat "you are already cracking a safe"};
cracking = true;

if (_art == "safe1") then 
{
(format ["%1 switchmove ""%2"";", player, "repairingkneel"]) call broadcast;
('if(iscop) then {playsound "alarm1";}') call broadcast;
(format ['server globalChat "A camera at the Rocky Ridge Credit Union has seen someone cracking the safe!";']) call broadcast;
sleep 5;
if ((random 100) < 40) then 
{
(format ["%1 switchmove ""%2"";", player, ""]) call broadcast;
player groupChat "You cracked the safe";
cracking = false;
Playsound "Unlock";
Safecracked1 = TRUE;
Sleep 60;
Safecracked1 = FALSE;
}
else
{
(format ["%1 switchmove ""%2"";", player, ""]) call broadcast;
player groupChat "You did not crack the safe, try again";
cracking = false;
};
cracking = false;
};
/*
if (_art == "safe2") then 
{
(format ["%1 switchmove ""%2"";", player, "repairingkneel"]) call broadcast;
sleep 5;
if ((random 100) < 40) then 
{
(format ["%1 switchmove ""%2"";", player, ""]) call broadcast;
player groupChat "You cracked the safe";
cracking = false;
Playsound "Unlock";
Safecracked2 = TRUE;
}
else
{
(format ["%1 switchmove ""%2"";", player, ""]) call broadcast;
player groupChat "You did not crack the safe, try again";
cracking = false;
};
cracking = false;
};

if (_art == "safe3") then 

{
(format ["%1 switchmove ""%2"";", player, "repairingkneel"]) call broadcast;
sleep 5;
if ((random 100) < 40) then 
{
(format ["%1 switchmove ""%2"";", player, ""]) call broadcast;
player groupChat "You cracked the safe";
cracking = false;
Playsound "Unlock";
Safecracked3 = TRUE;
}
else
{
(format ["%1 switchmove ""%2"";", player, ""]) call broadcast;
player groupChat "You did not crack the safe, try again";
cracking = false;
};
cracking = false;
};
*/

Share this post


Link to post
Share on other sites

Not sure if this works, try adding it in the beginning.

private ["_blufors"];
waitUntil {
sleep 1;
_blufors = 0;
{if(side _x == WEST) then {_blufors = _blufors + 1};} forEach playableUnits; _blufors >= 4;
};

You could also have a check for the amount of blufors where you are executing that script?

Share this post


Link to post
Share on other sites

Assuming that you are editing the standard arma 2 life mission then this would work.

_copplayernumber = 0;
for[{_i=0},{_i < (count playerarray)},{_i=_i+1}] do {
_curplayer = playerarray select _i;
if((isplayer _curplayer) && (!isnull _curplayer) && (_curplayer in coparray)) then {
	_copplayernumber = _copplayernumber + 1;
};
};

Then you could just use the variable _copplayernumber to run a simple exit-with check.

Share this post


Link to post
Share on other sites

Yes I am modifying the basic Island Life script. The thing is I don't want to have to place everyone's white-listed profile ID's in, I just want it to recognize that there are four blufor players online for the script to activate. Also where would I place that script-code for it to 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  

×