Author: RAVEN
Author Website:

Requirements: No addons required

Version: 1.0

Short description: It sets a sound alarm when someone from a predefined side enters the zone.
Date: 2008-12-13 17:48
Submitted by: Big

Comments: (0)


Alarm in the zone

It sets a sound alarm when someone from a predefined side enters the zone.
The alarm is activated and deactivated automatically and it only needs to be called once in the mission
The script creates a trigger and starts checking for enemy presence, staying in stand-by till its activation.
It's MP compatible cause the "sound source" is published at all the net stations automatically.

.sqf format (function)
// *******************************************************************************
// **      Function: SetAlarm.sqf
// **   Description: Sets a sound alarm in a zone
// *******************************************************************************
// **        Author: RAVEN/Rob
// **          Site:
// **
// **         Usage: [side,zone_center_object,zone_radious] execVM "SetAlarm.sqf";
// **                 side with quotes: example: "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 "Area de deteccion";
_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;
  if (_activa) then
   deletevehicle _soundOn;
   _activa = false;
   _espera = false;
It has to be called using:
["EAST", BASE, 300] execVM "SetAlarm.sqf";
    Parameter 1: Side of the enemy (using quotes) (example: "EAST","WEST").
    Parameter 2: Object name (usually a logic unit) center of the area to check.
    Parameter 3: Radious in meters of the zone.
Thanks & Credits:
Script created thanks to Rob Matao, cause he was looking for something like this and he also helped me to solve the activate/deactivate problems.

Forums Topic:

Enable javascript to be able to download from Armaholic please!

Tags: No tags