Morgen,
und zwar habe ich gerade 3 Sirenen in der Keyhandler... Sieht momentan so aus :
Spoiler anzeigen
//NUM_7 Key
case 71: {
if (playerSide in [west,independent] && {vehicle player != player} && {!life_siren_active} && {((driver vehicle player) == player)}) then {
[] spawn {
life_siren_active = true;
sleep 4.7;
life_siren_active = false;
};
_veh = vehicle player;
if (isNil {_veh getVariable "siren"}) then {_veh setVariable ["siren",false,true];};
if ((_veh getVariable "siren")) then {
titleText [localize "STR_MISC_SirensOFF","PLAIN"];
_veh setVariable ["siren",false,true];
} else {
titleText [localize "STR_MISC_SirensON","PLAIN"];
_veh setVariable ["siren",true,true];
if (playerSide isEqualTo west) then {
[_veh] remoteExec ["life_fnc_copSiren",RCLIENT];
} else {
[_veh] remoteExec ["life_fnc_medicSiren",RCLIENT];
};
};
};
};
// NUM_8 Key
case 72: {
if (playerSide in [west,independent] && {vehicle player != player} && {!life_siren_active} && {((driver vehicle player) == player)}) then {
[] spawn {
life_siren_active = true;
sleep 4.7;
life_siren_active = false;
};
_veh = vehicle player;
if (isNil {_veh getVariable "siren2"}) then {_veh setVariable ["siren2",false,true];};
if ((_veh getVariable "siren2")) then {
titleText ["Anhalte Signal AUS","PLAIN"];
_veh setVariable ["siren2",false,true];
} else {
titleText ["Anhalte Signal AN","PLAIN"];
_veh setVariable ["siren2",true,true];
if (playerSide isEqualTo west) then {
[_veh] remoteExec ["life_fnc_copSiren2",RCLIENT];
} else {
[_veh] remoteExec ["life_fnc_medicSiren2",RCLIENT];
};
};
};
};
// NUM_9 Key
case 73: {
if (playerSide in [west,independent] && {vehicle player != player} && {!life_siren_active} && {((driver vehicle player) == player)}) then {
[] spawn {
life_siren_active = true;
sleep 4.7;
life_siren_active = false;
};
_veh = vehicle player;
if (isNil {_veh getVariable "siren3"}) then {_veh setVariable ["siren3",false,true];};
if ((_veh getVariable "siren3")) then {
titleText ["Polizei Ansage AUS","PLAIN"];
_veh setVariable ["siren3",false,true];
} else {
titleText ["Polizei Ansage AN","PLAIN"];
_veh setVariable ["siren3",true,true];
if (playerSide isEqualTo west) then {
[_veh] remoteExec ["life_fnc_copSiren3",RCLIENT];
} else {
[_veh] remoteExec ["life_fnc_medicSiren3",RCLIENT];
};
};
};
};
Nun will ich aber das die Sirenen "siren & razzia" nur einmal abgespielt werden... Habe es so versucht :
Spoiler anzeigen
//F Key
case 33: {
if (!_shift && !_alt && playerSide in [west,independent] && {vehicle player != player} && {!life_siren_active} && {((driver vehicle player) == player)}) then {
[] spawn {
life_siren_active = true;
sleep 4.7;
life_siren_active = false;
};
_veh = vehicle player;
if (isNil {_veh getVariable "siren"}) then {_veh setVariable ["siren",false,true];};
if ((_veh getVariable "siren")) then {
titleText [localize "STR_MISC_SirensOFF","PLAIN"];
_veh setVariable ["siren",false,true];
} else {
titleText [localize "STR_MISC_SirensON","PLAIN"];
_veh setVariable ["siren",true,true];
if (playerSide isEqualTo west) then {
[_veh] remoteExec ["life_fnc_copSiren",RCLIENT];
} else {
[_veh] remoteExec ["life_fnc_medicSiren",RCLIENT];
};
};
};
if(_shift && !_alt && {((player getVariable "side") == "cop")} && {vehicle player != player} && {((driver vehicle player) == player)}) then
{
_veh = vehicle player;
if(!alive _veh) exitWith {};
player say3d "razzia";
};
if(!_shift && _alt && {((player getVariable "side") == "cop")} && {vehicle player != player} && {((driver vehicle player) == player)}) then
{
_veh = vehicle player;
if(!alive _veh) exitWith {};
player say3d "siren";
};
Hat da jemand eine Lösung ?