Tags: No tags
Alarm in the zone
by RAVEN Description: 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. Usage: .sqf format (function) // *******************************************************************************
// ** Function: SetAlarm.sqf
// ** Description: Sets a sound alarm in a zone
// *******************************************************************************
// ** Author: RAVEN/Rob
// ** Site: www.ArmedAssault.com.ar
// **
// ** 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;
}
}
else
{
if (_activa) then
{
deletevehicle _soundOn;
_activa = false;
_espera = false;
};
};
};
};
It has to be called using:["EAST", BASE, 300] execVM "SetAlarm.sqf";where:
Parameter 2: Object name (usually a logic unit) center of the area to check. Parameter 3: Radious in meters of the zone. 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: - armedassault.com.ar
Tags: No tags
|
||||||||||