OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: NightJay0044 on 10 Mar 2010, 03:49:46
-
How do you enable/disable alarm system depending on if the player is spotted before the alarm is set off?
Meaning, if the player is spotted before he disables the alarm, forces will be alerted, but if he can disable the alarm system before he is spotted, the forces won't be alerted.
How do i accomplish this?
also I would like to do this, via addaction command.
what is the proper code/syntax whichevver it is, i'm not much of a scripter, so unknown how.
Thanks.
-
1 - Add some object somewhere to contain the action to disable the alarm, name it alarm_device.
2 - In the init.sqf add
if (isNil "nj_alarm_enabled") then
{
nj_alarm_enabled = true;
alarm_device addAction ["disable alarm", "nj_disable_alarm.sqf"];
};
3 - Add a trigger covering the detection area and group it with the player. Activation: vehicle, "DETECTED BY OPFOR". In the Condition put this && nj_alarm_enabled
, in the trigger effects, select the alarm sound.
4 - Create a script named nj_disable_alarm.sqf
nj_alarm_enabled = false;
titleText["ALARM DISABLED", "PLAIN"];
-
Thansk mando, what is the addaction syntax code? A lot of things changed with Arma2..