fn_keyhandler.sqf
Code
//F Key
case 33: {
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 GVAR "siren"}) then {_veh SVAR ["siren",false,true];};
if((_veh GVAR "siren")) then {
titleText [localize "STR_MISC_SirensOFF","PLAIN"];
_veh SVAR ["siren",false,true];
} else {
titleText [localize "STR_MISC_SirensON","PLAIN"];
_veh SVAR ["siren",true,true];
if(playerSide == west) then {
[_veh] remoteExec ["life_fnc_copSiren",RCLIENT];
} else {
[_veh] remoteExec ["life_fnc_medicSiren",RCLIENT];
};
};
};
};
//F (YELP) Key
case 33: {
if(_shift) then
{
if(playerSide == west && vehicle player != player && !life_siren2_active && ((driver vehicle player) == player)) then{
[] spawn{
life_siren2_active = true;
sleep 1.2;
life_yelp_active = false;
};
_veh = vehicle player;
if(isNil {_veh getVariable "yelp"}) then {_veh setVariable["yelp",false,true];};
if((_veh getVariable "yelp")) then {
titleText ["Yelp Off","PLAIN"];
_veh setVariable["yelp",false,true];
} else {
titleText ["Yelp On","PLAIN"];
_veh setVariable["yelp",true,true];
[[_veh],"life_fnc_copYelp",nil,true] spawn life_fnc_MP;
};
};
};
};
Alles anzeigen
fn_copsiren2
Code
private["_vehicle"];
_vehicle = [_this,0,ObjNull,[ObjNull]]
call BIS_fnc_param;if(isNull _vehicle) exitWith {};
if(isNil {_vehicle getVariable "siren2"}) exitWith {};
while {true} do{
if(!(_vehicle getVariable "siren2")) exitWith {};
if(count (crew (_vehicle)) == 0) then {_vehicle setVariable["siren2",false,true]};
if(!alive _vehicle) exitWith {};
if(isNull _vehicle) exitWith {};
_vehicle say3D "Yelp";
sleep 4.7;
if(!(_vehicle getVariable "siren2")) exitWith {};};
Alles anzeigen