Home   Help Search Login Register  

Author Topic: How to recognize classes?  (Read 491 times)

0 Members and 1 Guest are viewing this topic.

DEAD RABBIT

  • Guest
How to recognize classes?
« on: 11 Aug 2004, 13:42:38 »
I got this script which simulates punching any soldier with your rifle. Something like A Talking Penguin made, but a lot better, because the ATP version allows you to kill soldier but also tanks, cars, etc with that action in a 2 meter radius.

I didn't like that, so I rewrote the script plus added random punching sounds and it looks a LOT better now.

However I didn't got rid of the killing cars and tanks problem.
I don't know how to get a class of any unit like man, car, tank etc like in the CfgVehicles list.

Could somebody plz tell me how to ID a unit if its a car or a tank or just a person?? without having to name any vehicles??

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:How to recognize classes?
« Reply #1 on: 11 Aug 2004, 13:49:22 »
Dunno .... would something like

counttype "man" >= 1

help?    It's little more than a guess.

Plenty of reviewed ArmA missions for you to play

DEAD RABBIT

  • Guest
Re:How to recognize classes?
« Reply #2 on: 11 Aug 2004, 14:03:42 »
Not exactly what I had in mind, but the trigger area is so small that it works equally good.

Thanks anyway  ;D

Offline Blanco

  • Former Staff
  • ****
Re:How to recognize classes?
« Reply #3 on: 11 Aug 2004, 19:38:57 »
Let's say you got a variable _unit in your script,...

To check _unit is in the manclass do this :

Code: [Select]
?"man" counttype [_unit] > 0 : hint "unit is a man"

The same thing with "tank", "plane", "car","ship",etc...

 
« Last Edit: 11 Aug 2004, 19:40:00 by Blanco »
Search or search or search before you ask.