Home   Help Search Login Register  

Author Topic: No weapon  (Read 467 times)

0 Members and 1 Guest are viewing this topic.

max_killer_payne

  • Guest
No weapon
« on: 25 Aug 2003, 15:30:06 »
How do you detect if a unit is unarmed? I no it wud b somethin like :

man hasWeapon "Null"

But i am not sure
« Last Edit: 25 Aug 2003, 15:30:40 by max_killer_payne »

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:No weapon
« Reply #1 on: 25 Aug 2003, 16:03:15 »
Here's how to find out:

Try it  ::)

I.e put yourself and a dude in the mission editor (let's call him dude), remove all his weapons and have a radio trigger present you with the result of the "hasWeapon" command.

In dude's init field:  
Code: [Select]
removeAllWeapons this
In a radio trigger:  
Code: [Select]
hint format ["dude hasWeapon ""null"" equals %1", dude hasWeapon "null"]
What I think? It wont give you the result you're after, i.e. wether dude has any weapons at all. hasWeapon checks if a unit has a certain weapon, not if it has no weapons at all. But perhaps "null" is interpreted as "no weapon at all". That'd be cool...

Good luck!

deaddog

  • Guest
Re:No weapon
« Reply #2 on: 25 Aug 2003, 16:24:29 »
Try this:

("_x != {binocular} and _x != {nvgoggles}" count (weapons player) + count (magazines player)) ==0

That will cover guns and handgrenades but not include binocs and nvg, which are considered weapons.

Komuna

  • Guest
Re:No weapon
« Reply #3 on: 26 Aug 2003, 10:36:05 »
'PrimaryWeapon _unit' returns the a string with the main weapon's name. If such string is equal to an empty one (""), then the unit has no primary weapon.

There's also the 'secondaryWeapon' command.
You can also use the "Weapons _unit" command to obtain an array with every weapons that a certain unit's carrying.

Therefore:

IF (primaryWeapon player == "") THEN {playerHasWeapon=false};
« Last Edit: 26 Aug 2003, 10:37:22 by Komuna »