Home   Help Search Login Register  

Author Topic: Alarm script  (Read 686 times)

0 Members and 1 Guest are viewing this topic.

2stonedPsi

  • Guest
Alarm script
« on: 17 Oct 2003, 21:07:47 »
hi, my first post :)

i need a alarm script that works. alarmtime = 20 secs. plz its for my new map, and the stupid alarm never ends  :-[

no triggers a SCRIPT plz  ::)

thx

Psi

Offline KTottE

  • Former Staff
  • ****
Re:Alarm script
« Reply #1 on: 17 Oct 2003, 21:12:03 »
Right, paste this into a file and save it as alarmScript.sqs

Code: [Select]
_object = _this select 0
_duration = _this select 1
_sound = _this select 2

_object say _sound
@(_time >= _duration)
deleteVehicle _object
exit

Now place an object on the map (can be anything, just name it)

And when you want to start your alarm, you use:

[objectname,20,"Alarm"] exec "alarmScript.sqs"

objectname is the name of the object where the alarm will originate, 20 is the time in seconds it will last, and "Alarm" is the sound you want to use, alarm in this case.

Viel glück :)

EDIT

Changed a bug in the script, now it shoul work.
« Last Edit: 17 Oct 2003, 21:47:43 by KTottE »
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming 'WOW What a Ride!'"

McHale

  • Guest
Re:Alarm script
« Reply #2 on: 17 Oct 2003, 23:04:01 »
Is there anyway to get the alarm to loop a few times? Because that script only plays the sound once...

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:Alarm script
« Reply #3 on: 18 Oct 2003, 00:16:28 »
Yep. Try something like this:
Code: [Select]
_object = _this select 0
_duration = _this select 1
_sound = _this select 2

#loop
_object say _sound
// The "Alarm" sound is about 10 secs
~10
?!(_time >= _duration): goto "loop"

deleteVehicle _object

exit
« Last Edit: 18 Oct 2003, 00:18:07 by Killswitch »