Jump to content

Police Sirens


Recommended Posts

That should work. Are you sure that you are using right car? Black SUV, police lada or police car? Does your antihack block actions? If so, you need to whitelist s_player_sirens_on and s_player_sirens_off.

how you do that ive tried but i must be doing it wrong lol.

Link to comment
Share on other sites

Okey so i try to set this in my server.First i Take this https://github.com/vbawol/DayZ-Epoch/blob/master/SQF/dayz_code/compile/fn_selfActions.sqf and i set it in my mission section in custom folder

I also did evething as said in first post. Here is also my fn_selfActions.sqf but still no option to set sirens on

 

Do you have custom compiles.sqf where you have called this fn_selfActions.sqf?

Link to comment
Share on other sites

  • 2 weeks later...

Hello Sukkaed,

 

Is there a way to change the loop to after 51 seconds? i have a different siren sound thats 51 seconds long

 

i tried this:

class CfgSounds
{
    sounds[] = {siren};
    class siren
    {
    name = "siren";
    sound[] = {scripts\sirens\siren.ogg,0.51,1};
    titles[] = {};
    };
};

but its looping contsantly?

Link to comment
Share on other sites

That is volume for the sound. Open sirens_on.sqf and replace this line

for "_i" from 1 to 12 do {

with this

for "_i" from 1 to 127 do {

But remember that you can only stop that sound between loops, so it will always play at least 51 seconds.

Link to comment
Share on other sites

Has anybody been working on the lightbar script part for the SUV? If so do you care to share it? I got a Rebel vs Police Force in my server and we sorta would like that!

 

Thanks

 

OtterNas3 has done it but as far as I know, it has not been released.

Link to comment
Share on other sites

I seem to have a problem with this. In certain vehicles, when you scroll, there
is the sirens on/sirens off option. When I select sirens on, the lights flash, as
they should, but I get a message about "no sound found", the siren.ogg file,
is where it belongs, in the sirens folder, along with the other two files.
What can be the problem?

 

:unsure:

Link to comment
Share on other sites

I guess that you didn't set up the command lines correct in the description.ext.

Compare it with mine

 

class CfgSounds
{
    sounds[] = {playerSnoring,lock,siren};
 
    class playerSnoring
    {
    name="playerSnoring";
    sound[]={\custom\sfx\snoring.ogg,0.9,1};
    titles[] = {};
    };

    class lock
    {
    name = "lock";
    sound[] = {\custom\sfx\lock.ogg,0.2,1};
    titles[] = {};
    };    
    
    class siren
    {
    name = "siren";
    sound[] = {custom\sfx\siren.ogg,0.5,1};
    titles[] = {};
    };
};

Link to comment
Share on other sites

Update:

 

When it's run on a local server. It works.

When it's run on our dedicated server, we have the "siren sound not found" error.

 

Weird thing is, that when comparing the self functions file, and the description.ext file

(comaring local to dedicated server files), they are identical as far as the sirens script.

 

:huh:

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 3 weeks later...

 

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;
	};
};

I added this code is no blue police lights red

I added the code a police car no blue and red lights

Link to comment
Share on other sites

Just incase you didn't know about it :) 

Error in expression <sirens,2,false,true,"",""];
};
} else {
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\custom\code\fn_selfActions.sqf, line 37

Spams the Clients Log Quite a bit :P 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

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