Home   Help Search Login Register  

Author Topic: Event Handler Question  (Read 777 times)

0 Members and 1 Guest are viewing this topic.

Ace Productions

  • Guest
Event Handler Question
« on: 07 Oct 2003, 09:03:22 »
I want to increase the dammage caused by a flak 88 and I though of using the event handler "hit" to achieve this.

From what I read, EH "hit" returns the unit shot (victim), the unit that fired the shot (shooter) and the dammage caused (scalar). The victim in my case will be a Tiger I tank and the shooter will be the Flak 88. What I want to achieve is every time a Tiger is hit by a flak 88, 0.3 to be added to the already existing dammage.

Can someone please help me to write the script?  ::)



Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:Event Handler Question
« Reply #1 on: 07 Oct 2003, 21:28:06 »
Try this as a hit EH on a Tiger tank:

Code: [Select]
requiredVersion "1.91"
private ["_victim","_shooter","_damage","_currDmg","_newDmg"]

?(count _this != 3): exit

_victim = _this select 0
_shooter = _this select 1
_damage = _this select 2

?!(typeof _shooter == "88"):exit

_currDmg = damage _victim
_newDmg = _currDmg + 0.3

_victim setDamage _newDmg

Ace Productions

  • Guest
Re:Event Handler Question
« Reply #2 on: 07 Oct 2003, 22:51:08 »
Killswitch a million thanks and it's working perfectly!!!  ;D

I hope u have as much cheese as u wish!!!