Home   Help Search Login Register  

Author Topic: what is wrong with this script  (Read 730 times)

0 Members and 1 Guest are viewing this topic.

Offline ryankaplan

  • Members
  • *
  • yeah...
what is wrong with this script
« on: 14 Oct 2004, 14:13:45 »
it is a dead body removal script.
but i only want it to delete dead bodies, not tanks or cars, or anything else.

_unit = _this select 0
? "man" counttype _unit > 0 : deletevehicle  

#vehicle
deletevehicle _unitd
deletevehicle _unitg
deletevehicle _unitc
exit

#deletevehicle
~4
deletevehicle _unit
exit


there is a problem with the line ? "man" counttype _unit > 0 : deletevehicle but i can't seem to figure out what it is.

i get the error message
"man" counttype _unit > l#l 0 : Error counttype : Type Object, Expected Array

any help will be appreaciated.



Kammak

  • Guest
Re:what is wrong with this script
« Reply #1 on: 14 Oct 2004, 15:53:41 »
You must place _unit in an array for countType to check it.

So change it to:

? "man" countType [_unit] >0:...

Also, I didn't check it, but I think the

:deleteVehicle

will not work.  Don't you mean

:goto "deletevehicle"

But that may not work, as I would imagine "deleteVehicle" is a reserved word, as it is a function in OFP.  I'd change the section  name to something else.
« Last Edit: 14 Oct 2004, 15:56:26 by Kammak »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:what is wrong with this script
« Reply #2 on: 14 Oct 2004, 16:18:03 »
Never use a word that is used by the game.     Sometimes it works ok, sometimes you get a nice error message and sometimes weird stuff happens.
Plenty of reviewed ArmA missions for you to play