mirror of
https://github.com/rambo/arma3_missions.git
synced 2024-08-30 16:52:13 +00:00
trying to fix event handlers
This commit is contained in:
parent
d65d077f7d
commit
91de24aa80
@ -22,7 +22,7 @@ diag_log format["createObj called, _target: %1, _playerno: %2, _player: %3", _ta
|
||||
//_tsk1 setSimpleTaskDestination (getPos _lzLoc);
|
||||
//(playersArray select _playerno) setCurrentTask _tsk1;
|
||||
_taskid = format["p%1_lz%2", _playerno, _lzLoc];
|
||||
[west,[_taskid],[format["Fly to and land within %1m of the next LZ", lzSize], "Next LZ", "LZ"],(getPos _lzLoc),true,5,true, "move", true] call BIS_fnc_taskCreate;
|
||||
[west,[_taskid],[format["Player %2: Fly to and land within %1m of the LZ", lzSize, _playerno], format["p%1 LZ", _playerno], "LZ"],(getPos _lzLoc),true,5,true, "move", true] call BIS_fnc_taskCreate;
|
||||
taskIdsArray set [_playerno, _taskid];
|
||||
|
||||
|
||||
|
@ -61,8 +61,8 @@ for [{_iX = 0}, {_iX < _maxplayers}, {_iX = _iX + 1}] do
|
||||
ferryingArray set [_iX, false];
|
||||
landingCompleteArray set [_iX, false];
|
||||
squadLoadedArray set [_iX, false];
|
||||
playersArray set [_iX, null];
|
||||
taskIdsArray set [_iX, null];
|
||||
playersArray set [_iX, ""];
|
||||
taskIdsArray set [_iX, ""];
|
||||
};
|
||||
publicVariable "squadMDArray";
|
||||
publicVariable "enemyMDArray";
|
||||
@ -70,6 +70,7 @@ publicVariable "AAMDArray";
|
||||
publicVariable "ferryingArray";
|
||||
publicVariable "landingCompleteArray";
|
||||
publicVariable "squadLoadedArray";
|
||||
publicVariable "playersArray";
|
||||
publicVariable "taskIdsArray";
|
||||
|
||||
missionInitComplete = true;
|
||||
|
@ -3,9 +3,9 @@ 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";}];
|
||||
_target addMPEventHandler ["respawn", {Null = unit, _playerno execVM "playerspawn.sqf";}];
|
||||
|
||||
|
||||
[null, _playerno] execVM "playerspawn.sqf";
|
||||
[_target, _playerno] execVM "playerspawn.sqf";
|
||||
|
@ -4,7 +4,7 @@ _playerno = _this select 1;
|
||||
|
||||
_taskid = taskIdsArray select _playerno;
|
||||
null = [_taskid, "FAILED", False] spawn BIS_fnc_taskSetState;
|
||||
taskIdsArray set [_playerno, null];
|
||||
taskIdsArray set [_playerno, ""];
|
||||
publicVariable "taskIdsArray";
|
||||
|
||||
_squadArray = squadMDArray select _playerno;
|
||||
|
@ -1,6 +1,12 @@
|
||||
diag_log format["playerspawn called, _this: %1", _this];
|
||||
_evt = _this select 0;
|
||||
_target = _this select 0;
|
||||
_playerno = _this select 1;
|
||||
playersArray set [_playerno, _target];
|
||||
publicVariable "playersArray";
|
||||
|
||||
_target addEventHandler ["killed", {Null = _this, _playerno execVM "playerkilled.sqf";}];
|
||||
_target addMPEventHandler ["mpkilled", {Null = _this, _playerno execVM "playerkilled.sqf";}];
|
||||
_target addEventHandler ["respawn", {Null = unit, _playerno execVM "playerspawn.sqf";}];
|
||||
|
||||
ferryingArray set [_playerno, false];
|
||||
landingCompleteArray set [_playerno, false];
|
||||
|
Loading…
Reference in New Issue
Block a user