add emp functionality
This commit is contained in:
28
framework/emp/functions/fn_playZapServer.sqf
Normal file
28
framework/emp/functions/fn_playZapServer.sqf
Normal 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
|
||||
];
|
||||
};
|
||||
Reference in New Issue
Block a user