mirror of
https://github.com/rambo/arma3_missions.git
synced 2024-08-30 16:52:13 +00:00
Cleanup on death, init on spawn
This commit is contained in:
parent
1856cb8842
commit
d65d077f7d
@ -1,17 +1,11 @@
|
||||
waitUntil {!(isNil "missionInitComplete")};
|
||||
diag_log format["initPlayer called, _this: %1", _this];
|
||||
|
||||
_target = _this select 0;
|
||||
_playerno = _this select 1;
|
||||
playersArray set [_playerno, _target];
|
||||
_target addMPEventHandler ["mpkilled", {Null = _this, _playerno execVM "playerkilled.sqf";}];
|
||||
_target addMPEventHandler ["respawn", {Null = _this, _playerno execVM "playerspawn.sqf";}];
|
||||
|
||||
|
||||
diag_log format["initPlayer called, _this: %1", _this];
|
||||
|
||||
ferryingArray set [_playerno, false];
|
||||
landingCompleteArray set [_playerno, false];
|
||||
publicVariable "ferryingArray";
|
||||
publicVariable "landingCompleteArray";
|
||||
null = [_target, lzList, [], _playerno] execVM "createObj.sqf";
|
||||
(playersArray select _playerno) addItem "SatchelCharge_Remote_Mag";
|
||||
(playersArray select _playerno) addweapon "NVGoggles";
|
||||
[null, _playerno] execVM "playerspawn.sqf";
|
||||
|
21
helotraining.Altis/playerkilled.sqf
Normal file
21
helotraining.Altis/playerkilled.sqf
Normal file
@ -0,0 +1,21 @@
|
||||
diag_log format["playerkilled called, _this: %1", _this];
|
||||
_evt = _this select 0;
|
||||
_playerno = _this select 1;
|
||||
|
||||
_taskid = taskIdsArray select _playerno;
|
||||
null = [_taskid, "FAILED", False] spawn BIS_fnc_taskSetState;
|
||||
taskIdsArray set [_playerno, null];
|
||||
publicVariable "taskIdsArray";
|
||||
|
||||
_squadArray = squadMDArray select _playerno;
|
||||
_enemyArray = enemyMDArray select _playerno;
|
||||
|
||||
{
|
||||
[_x, "east", _playerno] execVM "deleteSquad.sqf";
|
||||
} foreach _enemyArray;
|
||||
publicVariable "enemyMDArray";
|
||||
|
||||
{
|
||||
[_x, "west", _playerno] execVM "deleteSquad.sqf";
|
||||
} foreach _squadArray;
|
||||
publicVariable "squadMDArray";
|
11
helotraining.Altis/playerspawn.sqf
Normal file
11
helotraining.Altis/playerspawn.sqf
Normal file
@ -0,0 +1,11 @@
|
||||
diag_log format["playerspawn called, _this: %1", _this];
|
||||
_evt = _this select 0;
|
||||
_playerno = _this select 1;
|
||||
|
||||
ferryingArray set [_playerno, false];
|
||||
landingCompleteArray set [_playerno, false];
|
||||
publicVariable "ferryingArray";
|
||||
publicVariable "landingCompleteArray";
|
||||
null = [(playersArray select _playerno), lzList, [], _playerno] execVM "createObj.sqf";
|
||||
(playersArray select _playerno) addItem "SatchelCharge_Remote_Mag";
|
||||
(playersArray select _playerno) addweapon "NVGoggles";
|
Loading…
Reference in New Issue
Block a user