31 lines
839 B
Plaintext
31 lines
839 B
Plaintext
#include "..\script_component.hpp"
|
|
|
|
// This function is used to deploy an EMP device and trigger the EMP effects on all machines
|
|
// The EMP effect is triggered by the global event "QGVAR(event_empDeployed)"
|
|
// This function should be called on the server
|
|
|
|
if (!isServer) exitWith {};
|
|
|
|
//get center and radius
|
|
params [["_origin", objNull, [[], objNull]],["_radius",1500, [300]]];
|
|
|
|
if (_origin isEqualType []) then {
|
|
if (count _origin != 3) exitWith {
|
|
["Invalid origin position provided (%1)", _origin] call BIS_fnc_error;
|
|
};
|
|
};
|
|
|
|
if (_origin isEqualType objNull) then {
|
|
if (isNull _origin) exitWith {
|
|
["No origin object or position provided (%1)", _origin] call BIS_fnc_error;
|
|
};
|
|
_origin = getPosASL _origin;
|
|
};
|
|
|
|
[QGVAR(event_empDeployedPreCheck), [
|
|
random 100000,
|
|
_origin,
|
|
_radius
|
|
]] call CBA_fnc_globalEvent;
|
|
|
|
true; |