Home   Help Search Login Register  

Author Topic: Weapon question  (Read 542 times)

0 Members and 1 Guest are viewing this topic.

sgtGunneryHighway

  • Guest
Weapon question
« on: 18 Mar 2003, 03:45:55 »
How can i check (in a condition field) what weapon is fired?
ex :(i want to activate a trigger when the guy shoot with an ak and only an ak how can i do that?)

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Weapon question
« Reply #1 on: 18 Mar 2003, 12:21:34 »
I'm not an expert, but I suspect you want the event handler "fired".    Check it out in the command ref (look under one of the topics as well as the command addEventHandler) and FAQ, there is some stuff there.

The event handler activates when the loon fires.    That in turn activates a little script that you have written/borrowed which will check and see if it was an AK.   If it was then your variable goes to true and your trigger fires.
Plenty of reviewed ArmA missions for you to play

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Weapon question
« Reply #2 on: 18 Mar 2003, 13:34:55 »
lol SGH - i've been playing around with that yesterday and
guess where - Mogadishu island  ;D

OK, what you need to do is, put the code below into the
unit's init field:

this addEventHandler ["FIRED", {_this exec "script.sqs"}]


Now create the script and put following into:

?(_this select 1 == "AK47"): whatever you want to do then here
exit

If you want to check the contents of _this, then you can display
the whole array aswell by:

hint format ["%1", _this]

:note - i've choosen an AK47 - you need to alter it to exactly that weapon, you want or if it's AK in general, you will need
more conditions in a row.

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

sgtGunneryHighway

  • Guest
Re:Weapon question
« Reply #3 on: 18 Mar 2003, 18:28:32 »
great m8 your script work well
but tbh i used to use it with the BAS_satcom and he dont work with it :'(
i know there was a tread about that radio somewhere but i cant find it  :-\

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Weapon question
« Reply #4 on: 18 Mar 2003, 23:28:26 »
Well, when firing with the radio (shall it be BAS or SEB_nam),
the eventHandler fired doesn't get hot (how the hell you
pointed out what i was trying on mogadishu isle yesterday  :o)

Instead of using an eventHandler when firing the weapon "radio", i changed to use the condition:

"_x hasweapon ""BAS_satcom""" count (units mygroup) > 0

That way, you can check if any member of the group "has"
the radio (works in multiplayer aswell).

But it was an AK, you were asking for first - wasn't it?  ;)

~S~ CD
« Last Edit: 18 Mar 2003, 23:29:34 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted