hellwalker
New Member
Hey guys,
I added a custom sound in my server. The idea is to creat a bank alarm with some custom siren sound.
I did everything right and i get the sounds working. But there is one thing..
What i have so far, keeps the sound with the player, so no matter where i go, the sounds keeps playing loud, like it's connected to the player.
I wanted the sound to stay connected to a building or a place.
When i player gets inside an area it activates the sound, and if a player get away from the building, the sound will sart to fadeout...
Can anyone help me?
This is my scrips:
description.ext
mission.sqm
siren.sqf
This is a script based on this tutorial: http://opendayz.net/threads/adding-siren.10546/
I added a custom sound in my server. The idea is to creat a bank alarm with some custom siren sound.
I did everything right and i get the sounds working. But there is one thing..
What i have so far, keeps the sound with the player, so no matter where i go, the sounds keeps playing loud, like it's connected to the player.
I wanted the sound to stay connected to a building or a place.
When i player gets inside an area it activates the sound, and if a player get away from the building, the sound will sart to fadeout...
Can anyone help me?
This is my scrips:
description.ext
Code:
classCfgSounds{
sounds[]={introSong,siren};
class introSong
{
name="introSong";
sound[]={sound\intro.ogg,0.7,1};
titles[]={};
};
class siren{
name ="siren";
sound[]={sound\siren.ogg,1.5,1};
titles[]={};};
};
mission.sqm
Code:
class item12
{
position[]={1955.88,0.001,11141.2};
a=100;
b=100;
activationBy="ANY";
type="SWITCH";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="siren";
expCond="(vehicle player) in thislist;(player distance siren) < 100;";
expActiv="siren = [] execVM ""Scripts\siren.sqf"";";
expDesactiv="terminate siren;";
classEffects
{
};
};
siren.sqf
Code:
waitUntil {!isNull player};
playSound "siren";
sleep 5;
nonapsi_ef = ppEffectCreate ["colorCorrections",1505];
nonapsi_ef ppEffectAdjust [2,20,0,[0.0,0.0,0.0,0.0],[0.8*2,0.5*2,0.0,0.7],[0.9,0.9,0.9,0.0]];
nonapsi_ef ppEffectCommit 0;
nonapsi_ef ppEffectAdjust [1,0.6,-0.001,[0.0,0.0,0.0,0.0],[0.8*2,0.5*2,0.0,0.7],[0.9,0.9,0.9,0.0]];
nonapsi_ef ppEffectCommit 3;
nonapsi_ef ppEffectEnable true;
nonapsi_ef2 = ppEffectCreate ["filmGrain",1505];
nonapsi_ef2 ppEffectEnable true;
nonapsi_ef2 ppEffectAdjust [0.02,1,1,0.1,1,false];
nonapsi_ef2 ppEffectCommit 5;
sleep 8;
titleText ["Test!","PLAIN DOWN",3]; titleFadeOut 4;
sleep 5;
playSound "siren";
titleText ["Test","PLAIN DOWN",3]; titleFadeOut 4;
sleep 10;
r_player_inpain =true;
sleep 60;
r_player_cardiac =true;
sleep 60;
playSound "siren";
sleep 1;
r_player_injured =true;
sleep 60;
playSound "siren";
sleep 60;
playSound "siren";
sleep 1;
r_player_blood =1500;
sleep 60;
r_player_dead =false;
This is a script based on this tutorial: http://opendayz.net/threads/adding-siren.10546/