mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
moved air drop trigger server side Epoch Events
This commit is contained in:
parent
40f2c98f0c
commit
b477f4ffc3
@ -19,10 +19,6 @@ params ["_unitClass",["_trgt",player],["_doVariable",false],["_extraData",[]]];
|
||||
|
||||
_bomb = objNull;
|
||||
// diag_log format["DEBUG: Antagonist %1 Spawning on %2. Do variable: %3.", _unitClass, _trgt, _doVariable];
|
||||
|
||||
if(random 100 < 6)then{
|
||||
[] execFSM "\x\addons\a3_epoch_code\System\Event_Air_Drop.fsm";
|
||||
};
|
||||
if(_doVariable)then{_unitClass call EPOCH_unitSpawnIncrease;};//Assumes Antagonist is required.
|
||||
|
||||
_index = EPOCH_spawnIndex find _unitClass;
|
||||
|
29
Sources/epoch_server_settings/EpochEvents/AirDrop.sqf
Normal file
29
Sources/epoch_server_settings/EpochEvents/AirDrop.sqf
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
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
|
||||
_chance = 50;
|
||||
if (random 100 < _chance) then {
|
||||
|
||||
// get all alive players
|
||||
_players = [];
|
||||
{
|
||||
if (alive _x) then {_players pushBack _x};
|
||||
} forEach allPlayers;
|
||||
|
||||
// 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];
|
||||
};
|
||||
};
|
Loading…
Reference in New Issue
Block a user