Jump to content
Sign in to follow this  
stridev

How to turn alarm sound OFF?

Recommended Posts

I feel a little silly asking this since its a pretty basic thing going back to OFP, and I used to know how but the logic of it escapes me right now.

I can make the alarm sound upon detection, but how in the wide wide world of sports do you get it to go off again (after 30 seconds or so)?

Share this post


Link to post
Share on other sites

You can use a script.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// *******************************************************************************

// **      Function: SetAlarm.sqf

// **   Description: activate/Deactivate alarm in zone

// *******************************************************************************

// **        Author: RAVEN/Rob

// **          Site: www.ArmedAssault.com.ar

// **

// **           Use: [side, object_center_zone, ratio_of_zone] execVM "SetAlarm.sqf";

// **                 side between quotes: "WEST", "EAST"

// *******************************************************************************

private ["_obj","_radar","_espera","_lista","_SoundOn","_activa"];

_side = _this select 0;

_obj  = _this select 1;

_dist = _this select 2;

if (not isServer) exitWith {};

_espera = false;

_activa = false;

while {true} do

{

_radar = createTrigger ["EmptyDetector", position _obj];

_radar setTriggerActivation [_side, "present", true];

_radar setTriggerArea [_dist, _dist, 0, true];

_radar setTriggerStatements ["this", "", ""];

_radar setTriggerText "detection area of enemy side";

_radar setTriggerTimeout [0, 0, 0, false];

_radar setTriggerType "SWITCH";

_espera = true;

while {_espera} do

{

_lista = list _radar;

sleep 1.00;

if (count _lista > 0) then

{

 if (not _activa) then

 {

  _soundOn = createSoundSource ["Alarm", position _obj, [], 0];

  _activa = true;

 }

}

else

{

 if (_activa) then

 {

  deletevehicle _soundOn;

  _activa = false;

  _espera = false;

 };

};

};

};

Share this post


Link to post
Share on other sites

try with <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">playSound ""

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×