2017-02-28 18:33:28 +00:00
|
|
|
/*
|
|
|
|
Trigger Air drop client side via randomly selected player.
|
|
|
|
by Aaron Clark - EpochMod.com
|
|
|
|
|
|
|
|
Improvements and or bugfixes and other contributions are welcome via the github:
|
|
|
|
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server_settings/EpochEvents/AirDrop.sqf
|
|
|
|
*/
|
|
|
|
// 50% chance every 45 minutes by default
|
2017-05-02 12:35:38 +00:00
|
|
|
//[[[cog import generate_private_arrays ]]]
|
|
|
|
private ["_chance","_player","_players"];
|
|
|
|
//[[[end]]]
|
2017-02-28 18:33:28 +00:00
|
|
|
_chance = 50;
|
|
|
|
if (random 100 < _chance) then {
|
|
|
|
|
|
|
|
// get all alive players
|
2017-03-05 17:04:43 +00:00
|
|
|
_players = allPlayers select {alive _x};
|
2017-02-28 18:33:28 +00:00
|
|
|
|
|
|
|
// continue if players found alive
|
|
|
|
if !(_players isEqualTo []) then {
|
|
|
|
|
|
|
|
// select random player
|
|
|
|
_player = selectRandom _players;
|
|
|
|
|
|
|
|
// Trigger air drop via player
|
|
|
|
["B_Heli_Transport_01_F", _player, true] remoteExec ['EPOCH_unitSpawn',_player];
|
|
|
|
|
|
|
|
diag_log format["Epoch: Air Drop Triggered on %1", _player];
|
|
|
|
};
|
|
|
|
};
|