Jump to content

Police Sirens


Recommended Posts

Quick and simple togglable police sirens and blinking head lights to black SUV and Police Lada :)

 

Add to description.ext right above "class RscLoadingText : RscText"

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

Add to fn_selfActions.sqf right above "//Grab Flare"

//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"];

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

Make "Scripts" folder to your mission file root if you don't have it yet and place "sirens" folder inside.

Link to comment
Share on other sites

so should my description.ext look like this?

    class CfgSounds
{
    sounds[] = {intromusic,siren};
    class intromusic
    {
    name = "intromusic";
    sound[] = {intromusic.ogg,0.9,1};
    titles[] = {};
    };
    class siren
    {
    name = "siren";
    sound[] = {custom\sirens\siren.ogg,0.5,1};
    titles[] = {};
    };
Link to comment
Share on other sites

 

so should my description.ext look like this?

 

Add one more closing bracket at the end like this

    class CfgSounds
{
    sounds[] = {intromusic,siren};
    class intromusic
    {
    name = "intromusic";
    sound[] = {intromusic.ogg,0.9,1};
    titles[] = {};
    };
    class siren
    {
    name = "siren";
    sound[] = {custom\sirens\siren.ogg,0.5,1};
    titles[] = {};
    };
};
Link to comment
Share on other sites

works perfect its to bad we dont have any cars to put it on with working lightbars so u get the red/blue lights. also i have question the siren playes then cuts off then restarts is there away to make it continuous so there isnt a 1-2 sec delay in it restarting. 

Link to comment
Share on other sites

works perfect its to bad we dont have any cars to put it on with working lightbars so u get the red/blue lights. also i have question the siren playes then cuts off then restarts is there away to make it continuous so there isnt a 1-2 sec delay in it restarting. 

 

I have lightbars but they are too bright and inside a car. Would need some work to get those working correctly.

I haven't noticed any pause between loops. You can adjust the loop lenght in sirens_on.sqf

for "_i" from 1 to 12 do {
player action ["lightOn", _vehicle];
sleep 0.2;
player action ["lightOff", _vehicle];
sleep 0.2;
};

One loop lenght is 12 x that block, so if you change it to "from 1 to 9 do" it will start the next loop 1,2 seconds earlier.

Link to comment
Share on other sites

This is a realy cool feature, and my player love it. Bad is that the "blue light" just work with the s1203 ambulance i added an the Lada, i like it how its rotating on the ambulance would be nice if there is any chance to add this to the suv not just the noise :D

Link to comment
Share on other sites

I have lightbars but they are too bright and inside a car. Would need some work to get those working correctly.

I haven't noticed any pause between loops. You can adjust the loop lenght in sirens_on.sqf

for "_i" from 1 to 12 do {
player action ["lightOn", _vehicle];
sleep 0.2;
player action ["lightOff", _vehicle];
sleep 0.2;
};

One loop lenght is 12 x that block, so if you change it to "from 1 to 9 do" it will start the next loop 1,2 seconds earlier.

Link to comment
Share on other sites

For me this works:

//Sirens
_isCopcar = typeOf _vehicle in ["policecar","pook_H13_medevac_CIV"];

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;
    };
Link to comment
Share on other sites

 

For me this works:

 

fn_selfAction:

//Sirens
_isCopcar = typeOf _vehicle in ["policecar","pook_H13_medevac_CIV"];

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

description:

class CfgSounds
{
    sounds[] = {siren};
    class siren
    {
        name = "siren";
        sound[] = {custom\sirens\siren.ogg,0.5,1};
        titles[] = {};
    };
};
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...