Jump to content

Police Sirens


Recommended Posts

Sukkaed,

As always outstanding script! Nice work!

Do you think it would be possible to get the lights on time to work or isn´t in the Epoch files?

Thanks for the script :)!

Link to comment
Share on other sites

Thanks :)

 

What you mean with "get the lights on time to work"? Like those actual light bars in police car?

Damn sorry I ment on TOP :P Yes I mean those actual light bars on top. I thought there maybe is a function to get them to work.

Or something like this would be cool:

Ford-Explorer-Police-Interceptor-SUV-fro

 

but this would need the clients to download it too. So it will be a dream forever :P

Link to comment
Share on other sites

Here is my siren script with lights if someone wants to make it better. Red and blue lights are limited only to police car, because of position of lights.

 

Replace your sirens_on.sqf with this:

_vehicle = vehicle player;
_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]];
	sleep 0.13;
	deleteVehicle _redLight;
	sleep 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]];
	sleep 0.13;
	deleteVehicle _blueLight;
	sleep 0.13;
};

if (isnil ("sirensOn")) then {
    sirensOn = 0;
};
If (!_inVehicle) then {
    sirensOn = 0;
};
if (sirensOn == 0) then {
    sirensOn = 1;
    cutText ["Sirens ON!","PLAIN DOWN"];
};
while {sirensOn == 1} do {
	If (_inVehicle and (driver _vehicle == player)) then {
		_nul = [objNull, _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];
						sleep 0.2;
						player action ["lightOff", _vehicle];
						sleep 0.2;
					};
				sleep 0.2;
			};
		} else {
		sirensOn = 0;
	};
};
Link to comment
Share on other sites

description.ext::

 

class RscPicture
{
access=0;
type=0;
idc=-1;
style=48;
colorBackground[]={0,0,0,0};
colorText[]={1,1,1,1};
font="TahomaB";
sizeEx=0;
lineSpacing=0;
text="";
};
class CfgSounds
{
    sounds[] = {siren};
    class siren
    {
name = "siren";
sound[] = {Scripts\sirens\siren.ogg,0.5,1};
titles[] = {};
    };
};
class RscLoadingText : RscText
 
 
 
 
 
};
};
 
//Sirens
_isCopcar = typeOf _vehicle in ["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","policecar"];
 
if (_inVehicle and _isCopcar and (driver _vehicle == player)) then {
        dayz_addsirens = _vehicle;
    if (s_player_sirens_on < 0) then {
        s_player_sirens_on = dayz_addsirens addAction ["Siren on","Scripts\sirens\sirens_on.sqf",dayz_addsirens,2,false,true,"",""];
        s_player_sirens_off = dayz_addsirens addAction ["Siren off","Scripts\sirens\sirens_off.sqf",dayz_addsirens,2,false,true,"",""];
        };
    } else {
        dayz_addsirens removeAction s_player_sirens_on;
        dayz_addsirens removeAction s_player_sirens_off;
        s_player_sirens_on = -1;
        s_player_sirens_off = -1;
    };
 
//Grab Flare
if (_canPickLight and !dayz_hasLight and !_isPZombie) then {
if (s_player_grabflare < 0) then {
 
 
 
 
 
Overlapped some of the code so you could see if I missed a space or anything!
Link to comment
Share on other sites

I am new to the Epoch servers. I have had an origins server for a year now and you know what that is like. You just play, no control at all. So I am learning quickly that running an epoch server you spend more time learning then playing.

This was so easy to install. I did have a little help from Affraid

Thank you for your work.

TBs Thug

Link to comment
Share on other sites

Hmmm i want that red and blue lights on the SUV :D Wouldn´t i be cool if there are some on the rear mirror? like in that photo i posted ?

 

You could play around with positioning of lightpoints.

_blueLight lightAttachObject [_vehicle, [X, Y, Z]];
Link to comment
Share on other sites

 

You could play around with positioning of lightpoints.

_blueLight lightAttachObject [_vehicle, [X, Y, Z]];

Yeah I am going to do that!

Thanks :)

Link to comment
Share on other sites

Is it possible to make the lights global? By now they are only local when I turn them on.

 

You're right, it is local. I would thought that createvehicle makes it global. Maybe using puplicvariableserver makes it global. Have to try that.

Link to comment
Share on other sites

  • 2 weeks later...

Hey Sukkaed,

 

I've been looking for something like this for ages, thanks! I've got a slight problem though. The flashing lights for vehicles work fine, but the siren audio loop doesn't work for me. Now, I turned the description.ext file into an sqf format so I could place the script in, but now that I've converted it back to an ext file, when I log into the server I get a "Wait for Host" error (everyone who logs in does) and if I leave it as an sqf file, the siren doesn't work. Is there anything you'd suggest?

 

Thanks in advance,

Angel 

Link to comment
Share on other sites

hey,

what dou you mean by root folder? The folder with the init.sqf in it?

 

like instance....../Scripts/sirens....

 

It won´t work for me. The option for sirens on won´t come up.

 

I think this is the same error that sniper got

 

Cheers 

Exo

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
×
×
  • Create New...