Sukkaed Posted November 16, 2014 Author Report Share Posted November 16, 2014 Old and outdated script. I'll might update it if someone still uses this. Link to comment Share on other sites More sharing options...
Tricks Posted November 16, 2014 Report Share Posted November 16, 2014 We use it, players love it! Link to comment Share on other sites More sharing options...
Sukkaed Posted November 18, 2014 Author Report Share Posted November 18, 2014 Alright, here :) variables.sqf inside dayz_resetSelfActions block s_player_sirens_on = -1; s_player_sirens_off = -1; copcar_stoppolice = -1; fn_selfActions.sqf if (_inVehicle && (typeOf _vehicle in ["policecar","SUV_TK_CIV_EP1","SUV_TK_CIV_EP1_DZE1","SUV_TK_CIV_EP1_DZE2","SUV_TK_CIV_EP1_DZE3","SUV_TK_CIV_EP1_DZE4","LadaLM","LadaLM_DZE1","LadaLM_DZE2","LadaLM_DZE3","LadaLM_DZE4"]) && (driver _vehicle == player)) then { if ((_vehicle getVariable["sirenon",0]) == 0) then { if (s_player_sirens_on < 0) then { s_player_sirens_on = _vehicle addAction ["Sirens on","Scripts\sirens.sqf",[_vehicle,"start"],2,false,true,"",""]; }; }; if (sirensOn == 1) then { if (s_player_sirens_off < 0) then { s_player_sirens_off = _vehicle addAction ["Sirens off","Scripts\sirens.sqf",[_vehicle,"end"],2,false,true,"",""]; }; }; } else { _vehicle removeAction s_player_sirens_on; _vehicle removeAction s_player_sirens_off; _vehicle removeAction copcar_stoppolice; s_player_sirens_on = -1; s_player_sirens_off = -1; copcar_stoppolice = -1; }; save this as sirens.sqf inside Scripts folder //Vehicle Sirens -Sukkaed _case = (_this select 3) select 1; switch (_case) do { case "start": { private ["_vehicle","_inVehicle","_lightRed","_redLight","_lightBlue","_blueLight","_lastValidVehicles","_validVehicles","_nearPlayerVehicles"]; s_player_sirens_off = -1; _vehicle = (_this select 3) select 0; _vehicle setVariable["sirenon",1,true]; _inVehicle = (_vehicle != player); _lightRed = { _redLight = "#lightpoint" createVehicle (getPos _vehicle); _redLight setLightBrightness 0.03; _redLight setLightAmbient [ 0.5, 0, 0 ]; _redLight setLightColor [0.77,0.05,0.23]; _redLight lightAttachObject [_vehicle, [1, 0, 1.0]]; uiSleep 0.13; deleteVehicle _redLight; uiSleep 0.13; }; _lightBlue = { _blueLight = "#lightpoint" createVehicle (getPos _vehicle); _blueLight setLightBrightness 0.03; _blueLight setLightAmbient [ 0, 0, 0.5 ]; _blueLight setLightColor [0,0,1.0]; _blueLight lightAttachObject [_vehicle, [-1, 0, 1.0]]; uiSleep 0.13; deleteVehicle _blueLight; uiSleep 0.13; }; if (isNil ("sirensOn")) then { sirensOn = 0; }; if (sirensOn == 0) then { sirensOn = 1; cutText ["Sirens ON!","PLAIN DOWN"]; }; _vehicle removeAction s_player_sirens_on; _lastValidVehicles = []; while {sirensOn == 1} do { if (_inVehicle and (driver _vehicle == player)) then { _validVehicles = []; _nearPlayerVehicles = position _vehicle nearEntities [["Car","Motorcycle"],50]; if ((count _nearPlayerVehicles) > 0) then { { if (_x != _vehicle && ((count (crew _x)) > 0)) then { _validVehicles set [(count _validVehicles), _x]; }; } forEach _nearPlayerVehicles; }; if ((count _validVehicles) > 0) then { if ((count _lastValidVehicles) != (count _validVehicles)) then { _vehicle removeAction copcar_stoppolice; copcar_stoppolice = -1; _lastValidVehicles = _validVehicles; }; if (copcar_stoppolice < 0) then { copcar_stoppolice = _vehicle addAction ["STOP POLICE","Scripts\sirens.sqf",[_vehicle,"stop",_lastValidVehicles],2,true,true,"",""]; }; } else { _vehicle removeAction copcar_stoppolice; copcar_stoppolice = -1; }; [nil, _vehicle, rSAY, "siren", 120] call RE; [_vehicle, 200, true, (getPosATL _vehicle)] spawn player_alertZombies; if (_vehicle isKindOf "policecar") then { for "_i" from 1 to 10 do { call _lightRed; call _lightBlue; }; } else { for "_i" from 1 to 12 do { player action ["lightOn", _vehicle]; uiSleep 0.2; player action ["lightOff", _vehicle]; uiSleep 0.2; }; uiSleep 0.2; }; } else { sirensOn = 0; uiSleep 2; _vehicle setVariable["sirenon",0,true]; _vehicle removeAction s_player_sirens_off; _vehicle removeAction copcar_stoppolice; s_player_sirens_on = -1; s_player_sirens_off = -1; copcar_stoppolice = -1; }; }; }; case "end": { private ["_vehicle"]; _vehicle = (_this select 3) select 0; _vehicle setVariable["sirenon",0,true]; _vehicle removeAction s_player_sirens_off; sirensOn = 0; cutText ["Sirens OFF!","PLAIN DOWN"]; uiSleep 5; s_player_sirens_on = -1; }; case "stop": { private ["_vehicle", "_vehicleList", "_messageList", "_targetCrew"]; _vehicle = (_this select 3) select 0; _vehicleList = (_this select 3) select 2; _vehicle removeAction copcar_stoppolice; copcar_stoppolice = 0; _messageList = []; { _targetCrew = (crew _x); if ((count _targetCrew) > 0) then { { if (!isNull _x && alive _x) then { _messageList set [(count _messageList), _x]; }; } forEach _targetCrew; }; } forEach _vehicleList; if ((count _messageList) > 0) then { { [nil,(_x),"loc",rTITLETEXT,"! POLICE !\n\n! STOP YOUR VEHICLE - RIGHT NOW !","PLAIN",0] call RE; } forEach _messageList; }; uiSleep 30; copcar_stoppolice = -1; }; }; Use the siren sound from original post. Credits to OtterNas3 for remote stop message function. Schalldampfer 1 Link to comment Share on other sites More sharing options...
CaptainReid Posted November 20, 2014 Report Share Posted November 20, 2014 How do I actually 'start the siren'? Link to comment Share on other sites More sharing options...
Thug Posted December 15, 2014 Report Share Posted December 15, 2014 Is there any way to disable the Radio on the CVPI Police Cars from Overpoch? Does anyone know how to disable the Radio in the CVPI Police cars from Overpoch. If not, I guess i will take them out, because everyone i know that has got one in the pass has blown it up or sold it after about 5 minutes. I really like the cars BUT the radios SUCK. Link to comment Share on other sites More sharing options...
Tricks Posted December 28, 2014 Report Share Posted December 28, 2014 Alright, here :) variables.sqf inside dayz_resetSelfActions block s_player_sirens_on = -1; s_player_sirens_off = -1; copcar_stoppolice = -1; fn_selfActions.sqf if (_inVehicle && (typeOf _vehicle in ["policecar","SUV_TK_CIV_EP1","SUV_TK_CIV_EP1_DZE1","SUV_TK_CIV_EP1_DZE2","SUV_TK_CIV_EP1_DZE3","SUV_TK_CIV_EP1_DZE4","LadaLM","LadaLM_DZE1","LadaLM_DZE2","LadaLM_DZE3","LadaLM_DZE4"]) && (driver _vehicle == player)) then { if ((_vehicle getVariable["sirenon",0]) == 0) then { if (s_player_sirens_on < 0) then { s_player_sirens_on = _vehicle addAction ["Sirens on","Scripts\sirens.sqf",[_vehicle,"start"],2,false,true,"",""]; }; }; if (sirensOn == 1) then { if (s_player_sirens_off < 0) then { s_player_sirens_off = _vehicle addAction ["Sirens off","Scripts\sirens.sqf",[_vehicle,"end"],2,false,true,"",""]; }; }; } else { _vehicle removeAction s_player_sirens_on; _vehicle removeAction s_player_sirens_off; _vehicle removeAction copcar_stoppolice; s_player_sirens_on = -1; s_player_sirens_off = -1; copcar_stoppolice = -1; }; save this as sirens.sqf inside Scripts folder //Vehicle Sirens -Sukkaed _case = (_this select 3) select 1; switch (_case) do { case "start": { private ["_vehicle","_inVehicle","_lightRed","_redLight","_lightBlue","_blueLight","_lastValidVehicles","_validVehicles","_nearPlayerVehicles"]; s_player_sirens_off = -1; _vehicle = (_this select 3) select 0; _vehicle setVariable["sirenon",1,true]; _inVehicle = (_vehicle != player); _lightRed = { _redLight = "#lightpoint" createVehicle (getPos _vehicle); _redLight setLightBrightness 0.03; _redLight setLightAmbient [ 0.5, 0, 0 ]; _redLight setLightColor [0.77,0.05,0.23]; _redLight lightAttachObject [_vehicle, [1, 0, 1.0]]; uiSleep 0.13; deleteVehicle _redLight; uiSleep 0.13; }; _lightBlue = { _blueLight = "#lightpoint" createVehicle (getPos _vehicle); _blueLight setLightBrightness 0.03; _blueLight setLightAmbient [ 0, 0, 0.5 ]; _blueLight setLightColor [0,0,1.0]; _blueLight lightAttachObject [_vehicle, [-1, 0, 1.0]]; uiSleep 0.13; deleteVehicle _blueLight; uiSleep 0.13; }; if (isNil ("sirensOn")) then { sirensOn = 0; }; if (sirensOn == 0) then { sirensOn = 1; cutText ["Sirens ON!","PLAIN DOWN"]; }; _vehicle removeAction s_player_sirens_on; _lastValidVehicles = []; while {sirensOn == 1} do { if (_inVehicle and (driver _vehicle == player)) then { _validVehicles = []; _nearPlayerVehicles = position _vehicle nearEntities [["Car","Motorcycle"],50]; if ((count _nearPlayerVehicles) > 0) then { { if (_x != _vehicle && ((count (crew _x)) > 0)) then { _validVehicles set [(count _validVehicles), _x]; }; } forEach _nearPlayerVehicles; }; if ((count _validVehicles) > 0) then { if ((count _lastValidVehicles) != (count _validVehicles)) then { _vehicle removeAction copcar_stoppolice; copcar_stoppolice = -1; _lastValidVehicles = _validVehicles; }; if (copcar_stoppolice < 0) then { copcar_stoppolice = _vehicle addAction ["STOP POLICE","Scripts\sirens.sqf",[_vehicle,"stop",_lastValidVehicles],2,true,true,"",""]; }; } else { _vehicle removeAction copcar_stoppolice; copcar_stoppolice = -1; }; [nil, _vehicle, rSAY, "siren", 120] call RE; [_vehicle, 200, true, (getPosATL _vehicle)] spawn player_alertZombies; if (_vehicle isKindOf "policecar") then { for "_i" from 1 to 10 do { call _lightRed; call _lightBlue; }; } else { for "_i" from 1 to 12 do { player action ["lightOn", _vehicle]; uiSleep 0.2; player action ["lightOff", _vehicle]; uiSleep 0.2; }; uiSleep 0.2; }; } else { sirensOn = 0; uiSleep 2; _vehicle setVariable["sirenon",0,true]; _vehicle removeAction s_player_sirens_off; _vehicle removeAction copcar_stoppolice; s_player_sirens_on = -1; s_player_sirens_off = -1; copcar_stoppolice = -1; }; }; }; case "end": { private ["_vehicle"]; _vehicle = (_this select 3) select 0; _vehicle setVariable["sirenon",0,true]; _vehicle removeAction s_player_sirens_off; sirensOn = 0; cutText ["Sirens OFF!","PLAIN DOWN"]; uiSleep 5; s_player_sirens_on = -1; }; case "stop": { private ["_vehicle", "_vehicleList", "_messageList", "_targetCrew"]; _vehicle = (_this select 3) select 0; _vehicleList = (_this select 3) select 2; _vehicle removeAction copcar_stoppolice; copcar_stoppolice = 0; _messageList = []; { _targetCrew = (crew _x); if ((count _targetCrew) > 0) then { { if (!isNull _x && alive _x) then { _messageList set [(count _messageList), _x]; }; } forEach _targetCrew; }; } forEach _vehicleList; if ((count _messageList) > 0) then { { [nil,(_x),"loc",rTITLETEXT,"! POLICE !\n\n! STOP YOUR VEHICLE - RIGHT NOW !","PLAIN",0] call RE; } forEach _messageList; }; uiSleep 30; copcar_stoppolice = -1; }; }; [/spolier] Use the siren sound from original post. Credits to OtterNas3 for remote stop message function. I am getting this error: dayz_addsirens removeAction s_player_sir> Error position: <dayz_addsirens removeAction s_player_sir> Error Undefined variable in expression: dayz_addsirens File mpmissions\__CUR_MP.Chernarus\Functions\fn_selfActions.sqf, line 71 Error in expression <sirens,2,false,true,"",""]; When I define the variable dayz_addsirens = -1; in my variables.sqf my plot management and door management stop working. I guess I am doing it wrong, is there another way? Maybe dayz_addsirens = objNull; in my init.sqf or variables.sqf? Link to comment Share on other sites More sharing options...
Sukkaed Posted December 28, 2014 Author Report Share Posted December 28, 2014 Don't use fn_selfaction part from the OP. Use what I posted last. It doesn't have dayz_addsirens. Link to comment Share on other sites More sharing options...
bobbart Posted December 29, 2014 Report Share Posted December 29, 2014 Hmm only people in the car can see the lights? Is there a way to change this? Link to comment Share on other sites More sharing options...
Sukkaed Posted December 29, 2014 Author Report Share Posted December 29, 2014 Lights in police car are local in this version. Link to comment Share on other sites More sharing options...
bobbart Posted December 29, 2014 Report Share Posted December 29, 2014 Local as in anyone local can see them or local as in only the driver can see them ? Having a siren with no lights is kind of pointless and atm that is what I have since no one but the driver sees them Link to comment Share on other sites More sharing options...
Sukkaed Posted December 30, 2014 Author Report Share Posted December 30, 2014 Yes, only driver can see it. This script is about adding sirens like the topic says. If you want working lights, try to look somewhere else. Link to comment Share on other sites More sharing options...
bobbart Posted December 30, 2014 Report Share Posted December 30, 2014 The lights were added with the siren, logic would dictate that it too would be supported here. Thanks anyway. Link to comment Share on other sites More sharing options...
Goonfather Posted January 9, 2015 Report Share Posted January 9, 2015 I have installed this script - And i can se the Siren menu, also push on the button - But there's no sound whatso ever... Im running InfiStar, but i can't se where to whitelist in the AhConfig Link to comment Share on other sites More sharing options...
DangerRuss Posted January 10, 2015 Report Share Posted January 10, 2015 do these sirens cause the same crazy desync that the police sirens on overwatch/overpoch cause when left on? Link to comment Share on other sites More sharing options...
Sukkaed Posted January 12, 2015 Author Report Share Posted January 12, 2015 No. It's lights what cause desync on ow cop cars because those use pv loop to all players. DangerRuss 1 Link to comment Share on other sites More sharing options...
hellraver Posted May 25, 2015 Report Share Posted May 25, 2015 This script has a very unsightly Bug.Replace this line [_vehicle, 200, true, (getPosATL _vehicle)] spawn player_alertZombies; with this code [player, 200, true, (getPosATL player)] spawn player_alertZombies; Is better if you want that the zombies are still a danger to the players.Do not do it to change, the zombies will always stay beside the car.The player can get out off the car and the zombies will not chase the player. Link to comment Share on other sites More sharing options...
Oshydaka Posted November 2, 2015 Report Share Posted November 2, 2015 Alright, here :) variables.sqf inside dayz_resetSelfActions blocks_player_sirens_on = -1; s_player_sirens_off = -1; copcar_stoppolice = -1;fn_selfActions.sqfif (_inVehicle && (typeOf _vehicle in ["policecar","SUV_TK_CIV_EP1","SUV_TK_CIV_EP1_DZE1","SUV_TK_CIV_EP1_DZE2","SUV_TK_CIV_EP1_DZE3","SUV_TK_CIV_EP1_DZE4","LadaLM","LadaLM_DZE1","LadaLM_DZE2","LadaLM_DZE3","LadaLM_DZE4"]) && (driver _vehicle == player)) then { if ((_vehicle getVariable["sirenon",0]) == 0) then { if (s_player_sirens_on < 0) then { s_player_sirens_on = _vehicle addAction ["Sirens on","Scripts\sirens.sqf",[_vehicle,"start"],2,false,true,"",""]; }; }; if (sirensOn == 1) then { if (s_player_sirens_off < 0) then { s_player_sirens_off = _vehicle addAction ["Sirens off","Scripts\sirens.sqf",[_vehicle,"end"],2,false,true,"",""]; }; }; } else { _vehicle removeAction s_player_sirens_on; _vehicle removeAction s_player_sirens_off; _vehicle removeAction copcar_stoppolice; s_player_sirens_on = -1; s_player_sirens_off = -1; copcar_stoppolice = -1; };save this as sirens.sqf inside Scripts folder//Vehicle Sirens -Sukkaed _case = (_this select 3) select 1; switch (_case) do { case "start": { private ["_vehicle","_inVehicle","_lightRed","_redLight","_lightBlue","_blueLight","_lastValidVehicles","_validVehicles","_nearPlayerVehicles"]; s_player_sirens_off = -1; _vehicle = (_this select 3) select 0; _vehicle setVariable["sirenon",1,true]; _inVehicle = (_vehicle != player); _lightRed = { _redLight = "#lightpoint" createVehicle (getPos _vehicle); _redLight setLightBrightness 0.03; _redLight setLightAmbient [ 0.5, 0, 0 ]; _redLight setLightColor [0.77,0.05,0.23]; _redLight lightAttachObject [_vehicle, [1, 0, 1.0]]; uiSleep 0.13; deleteVehicle _redLight; uiSleep 0.13; }; _lightBlue = { _blueLight = "#lightpoint" createVehicle (getPos _vehicle); _blueLight setLightBrightness 0.03; _blueLight setLightAmbient [ 0, 0, 0.5 ]; _blueLight setLightColor [0,0,1.0]; _blueLight lightAttachObject [_vehicle, [-1, 0, 1.0]]; uiSleep 0.13; deleteVehicle _blueLight; uiSleep 0.13; }; if (isNil ("sirensOn")) then { sirensOn = 0; }; if (sirensOn == 0) then { sirensOn = 1; cutText ["Sirens ON!","PLAIN DOWN"]; }; _vehicle removeAction s_player_sirens_on; _lastValidVehicles = []; while {sirensOn == 1} do { if (_inVehicle and (driver _vehicle == player)) then { _validVehicles = []; _nearPlayerVehicles = position _vehicle nearEntities [["Car","Motorcycle"],50]; if ((count _nearPlayerVehicles) > 0) then { { if (_x != _vehicle && ((count (crew _x)) > 0)) then { _validVehicles set [(count _validVehicles), _x]; }; } forEach _nearPlayerVehicles; }; if ((count _validVehicles) > 0) then { if ((count _lastValidVehicles) != (count _validVehicles)) then { _vehicle removeAction copcar_stoppolice; copcar_stoppolice = -1; _lastValidVehicles = _validVehicles; }; if (copcar_stoppolice < 0) then { copcar_stoppolice = _vehicle addAction ["STOP POLICE","Scripts\sirens.sqf",[_vehicle,"stop",_lastValidVehicles],2,true,true,"",""]; }; } else { _vehicle removeAction copcar_stoppolice; copcar_stoppolice = -1; }; [nil, _vehicle, rSAY, "siren", 120] call RE; [_vehicle, 200, true, (getPosATL _vehicle)] spawn player_alertZombies; if (_vehicle isKindOf "policecar") then { for "_i" from 1 to 10 do { call _lightRed; call _lightBlue; }; } else { for "_i" from 1 to 12 do { player action ["lightOn", _vehicle]; uiSleep 0.2; player action ["lightOff", _vehicle]; uiSleep 0.2; }; uiSleep 0.2; }; } else { sirensOn = 0; uiSleep 2; _vehicle setVariable["sirenon",0,true]; _vehicle removeAction s_player_sirens_off; _vehicle removeAction copcar_stoppolice; s_player_sirens_on = -1; s_player_sirens_off = -1; copcar_stoppolice = -1; }; }; }; case "end": { private ["_vehicle"]; _vehicle = (_this select 3) select 0; _vehicle setVariable["sirenon",0,true]; _vehicle removeAction s_player_sirens_off; sirensOn = 0; cutText ["Sirens OFF!","PLAIN DOWN"]; uiSleep 5; s_player_sirens_on = -1; }; case "stop": { private ["_vehicle", "_vehicleList", "_messageList", "_targetCrew"]; _vehicle = (_this select 3) select 0; _vehicleList = (_this select 3) select 2; _vehicle removeAction copcar_stoppolice; copcar_stoppolice = 0; _messageList = []; { _targetCrew = (crew _x); if ((count _targetCrew) > 0) then { { if (!isNull _x && alive _x) then { _messageList set [(count _messageList), _x]; }; } forEach _targetCrew; }; } forEach _vehicleList; if ((count _messageList) > 0) then { { [nil,(_x),"loc",rTITLETEXT,"! POLICE !\n\n! STOP YOUR VEHICLE - RIGHT NOW !","PLAIN",0] call RE; } forEach _messageList; }; uiSleep 30; copcar_stoppolice = -1; }; };Use the siren sound from original post. Credits to OtterNas3 for remote stop message function.HiWhen i use that, i got the action Sirens On & Sirens Off repeating a lot, like "Gear, Sirens On, Sirens On, Sirens Off, Sirens On, Sirens Off, Get Out", etc...What can i do to prevent this ?Thanks Link to comment Share on other sites More sharing options...
hellraver Posted March 28, 2017 Report Share Posted March 28, 2017 On 30.12.2014 at 5:31 AM, Sukkaed said: Yes, only driver can see it. This script is about adding sirens like the topic says. If you want working lights, try to look somewhere else. This statement is not very helpful. If you already offer a script then you should do it right. I have now written a public version and all players can see the lights. You can turn on the lights on my script and leave the vehicle. You can also leave the server and join again. The lights will continue to flash when you forget to turn them off. So write a decent script ;-) Link to comment Share on other sites More sharing options...
juandayz Posted March 28, 2017 Report Share Posted March 28, 2017 23 minutes ago, hellraver said: This statement is not very helpful. If you already offer a script then you should do it right. I have now written a public version and all players can see the lights. You can turn on the lights on my script and leave the vehicle. You can also leave the server and join again. The lights will continue to flash when you forget to turn them off. So write a decent script ;-) On 30/12/2014 at 1:31 AM, Sukkaed said: i think you need wait others 3 years to get a response. Do you wanna share your adaptation mate? Link to comment Share on other sites More sharing options...
hellraver Posted March 30, 2017 Report Share Posted March 30, 2017 I was aware that the topic is 3 years old Yes, I will soon share my script. Link to comment Share on other sites More sharing options...
Schalldampfer Posted January 15, 2018 Report Share Posted January 15, 2018 This script is still working, except for deleted policecar Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now