Home   Help Search Login Register  

Author Topic: Enable/disable alarm system  (Read 2810 times)

0 Members and 1 Guest are viewing this topic.

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Enable/disable alarm system
« 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.  
« Last Edit: 10 Mar 2010, 03:51:37 by NightJay0044 »
Who's hyped for Arma4, long live Arma!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Enable/disable alarm system
« Reply #1 on: 10 Mar 2010, 13:01:24 »
1 - Add some object somewhere to contain the action to disable the alarm, name it alarm_device.
2 - In the init.sqf add
Code: [Select]
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
Code: [Select]
this && nj_alarm_enabled, in the trigger effects, select the alarm sound.
4 - Create a script named nj_disable_alarm.sqf
Code: [Select]
nj_alarm_enabled = false;
titleText["ALARM DISABLED", "PLAIN"];

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re: Enable/disable alarm system
« Reply #2 on: 11 Mar 2010, 03:09:27 »
Thansk mando, what is the addaction syntax code? A lot of things changed with Arma2..
Who's hyped for Arma4, long live Arma!