Last active
August 29, 2015 14:04
-
-
Save headswe/5322533dd5678a6f53c1 to your computer and use it in GitHub Desktop.
Example of addaction and bis_fnc_mp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fnc_OnLaptopInteract = { | |
// send [], to function "fnc_mission_OnUseLaptop", false = to server, isPersistent = false | |
[[], "fnc_mission_OnUseLaptop", false, false] spawn BIS_fnc_MP; // launch a RPC to the server telling it to execute the function called "fnc_mission_OnUseLaptop" | |
}; | |
fnc_mission_OnUseLaptop = | |
{ | |
_countdown = 300; | |
MyNonPrivateValue = 5; | |
while{_countdown > 0 || !triggerActivated _trg} do // while count is under 300 and the trigger has not been activated keep counting | |
{ | |
_countdown = _countdown - 1; // remove one second from the countdown | |
uiSleep 1; // uiSleep is exactly 1 second. | |
}; | |
if(_countdown <= 0) then // we counted down | |
{ | |
//win | |
} | |
else // enemy got to the plane or something | |
{ | |
// lost | |
}; | |
}; | |
add in addaction code | |
[] spawn fnc_OnLaptopInteract; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment