Hallo zusammen,
ich bekomm es einfach derzeit nicht hin, eine Sirene ins Spiel zu integrieren... Kann da evtl. mal einer Drüberschauen und mir sagen, was ich da falsch mache?
Code: fn_copSirenStadt.sqf
#include "..\..\script_macros.hpp"
/*
File: fn_copSiren.sqf
Author: Bryan "Tonic" Boardwine
Description:
Starts the cop siren sound for other players.
*/
private ["_vehicle"];
_vehicle = param [0,objNull,[objNull]];
if (isNull _vehicle) exitWith {};
if (isNil {_vehicle getVariable "siren2"}) exitWith {};
for "_i" from 0 to 1 step 0 do {
if (!(_vehicle getVariable "siren2")) exitWith {};
if (count crew _vehicle isEqualTo 0) then {_vehicle setVariable ["siren2",false,true]};
if (!alive _vehicle) exitWith {};
if (isNull _vehicle) exitWith {};
_vehicle say3D "polizei_stadt";//Class name specified in description.ext
sleep 4.310;//Exactly matches the length of the audio file.
if (!(_vehicle getVariable "siren2")) exitWith {};
};
Alles anzeigen
Code: Eintragung im fn_keyhandler
//Ö Taste (Polizei Stadthorn)
case 39: {
if (playerSide in [west,independent] && {vehicle player != player} && {!life_siren_active} && {((driver vehicle player) == player)}) then {
[] spawn {
life_siren_active = true;
sleep 4.31;
life_siren_active = false;
};
_veh = vehicle player;
if (isNil {_veh getVariable "siren2"}) then {_veh setVariable ["siren2",false,true];};
if ((_veh getVariable "polizeiStadt")) then {
titleText ["Stadthorn AUS","PLAIN"];
_veh setVariable ["siren2",false,true];
} else {
titleText ["Stadthorn AN","PLAIN"];
_veh setVariable ["siren2",true,true];
if (playerSide isEqualTo west) then {
[_veh] remoteExec ["life_fnc_copSirenStadt",RCLIENT];
};
};
};
};
Alles anzeigen