add emp functionality

This commit is contained in:
2024-02-08 19:43:55 -08:00
parent 2c733f77df
commit e0e06eff5e
15 changed files with 249 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
#include "..\script_component.hpp"
params [["_object", objNull, [objNull]]];
if (isNull _object) exitWith {};
if (_object isKindOf "CAManBase") exitWith {};
// we're broadcasting a playSound3D command to all clients,
// so this only be run on the server
if (!isServer) exitWith {};
private _playSound = selectRandomWeighted [true,GVAR(chanceToPlayZap),false,(100-GVAR(chanceToPlayZap))];
if (_playSound) then {
private _sound = selectRandom ["zap1","zap2","zap3","zap4"];
playSound3D [
format [
"%1.wss",
getMissionPath ("framework\emp\sounds\" + _sound)
],
_object,
false,
getPosASL _object,
1, // volume
1, // pitch
GVAR(zapAudibleDistance), // max distance heard
0, // time offset sec
false // NOT local, send to all clients
];
};