Skip to content

Instantly share code, notes, and snippets.

@headswe
Last active August 29, 2015 14:04
Show Gist options
  • Save headswe/5322533dd5678a6f53c1 to your computer and use it in GitHub Desktop.
Save headswe/5322533dd5678a6f53c1 to your computer and use it in GitHub Desktop.
Example of addaction and bis_fnc_mp
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