2015-01-11 18:24:19 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
PARAMS_1(_laserTarget);
|
|
|
|
|
|
|
|
TRACE_1("enter", _this);
|
|
|
|
|
|
|
|
// Add the target to the global targets array
|
|
|
|
// Everyone tracks them
|
|
|
|
|
|
|
|
// Add the laser localized to the laser array, and give it the default localized code
|
|
|
|
PUSH(ACE_LASERS, _laserTarget);
|
|
|
|
// Check the vehicle, otherwise use the default
|
2015-04-08 15:35:24 +00:00
|
|
|
_laserTarget setVariable ["ACE_LASER_CODE", ACE_DEFAULT_LASER_CODE, false];
|
2015-01-11 18:24:19 +00:00
|
|
|
// Clean the lasers of any null objects while we are here
|
|
|
|
REM(ACE_LASERS, objNull);
|
|
|
|
|
|
|
|
if(!(local _laserTarget)) exitWith { };
|
|
|
|
// The target is local, so its on this client
|
|
|
|
if(!isDedicated) then {
|
2015-04-07 19:11:28 +00:00
|
|
|
_laserTarget setVariable ["ACE_LASERTARGET_SHOOTER", ACE_player, true];
|
2015-04-02 16:35:36 +00:00
|
|
|
|
2015-04-07 19:35:34 +00:00
|
|
|
[FUNC(laserTargetPFH), 0, [_laserTarget, ACE_player]] call cba_fnc_addPerFrameHandler;
|
2015-01-11 18:24:19 +00:00
|
|
|
} else {
|
2015-04-02 16:35:36 +00:00
|
|
|
// server side ownership of laser
|
|
|
|
//_laserTarget setVariable ["ACE_LASERTARGET_SHOOTER", nil, false];
|
2015-01-11 18:24:19 +00:00
|
|
|
};
|