Home   Help Search Login Register  

Author Topic: Check if unit has smoke shells left?  (Read 593 times)

0 Members and 1 Guest are viewing this topic.

Black Operative

  • Guest
Check if unit has smoke shells left?
« on: 17 Jun 2003, 19:50:20 »
Hi again! :)

Today I'd like to know if it's possible to check if a unit has smoke shells left in his inventory. Thanks for any answers! :)

Kaliyuga

  • Guest
Re:Check if unit has smoke shells left?
« Reply #1 on: 17 Jun 2003, 20:42:40 »
 You sure can... check it out:


Command :
Ammo
 
Description :
Used to check how much ammo is left in a weapon.
 
Syntax :
UnitName Ammo "WeaponName"
 
UnitName is the name of the unit you are checking
WeaponName is the name of the weapon you want to check. Check the Weapon/Ammo Type List for valid ammo types.
 
Returns :
Number of rounds remaining in the weapon.

Example :
?(MyGuy ammo "M16" == 0):aP sidechat "Reload damn it!"
 

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Re:Check if unit has smoke shells left?
« Reply #2 on: 17 Jun 2003, 21:59:21 »
Eh Kali can you? As a smokeshell is only a mag, not a weapon to which you have magazines, that returns 0 always. So instead, u can use:
Code: [Select]
? ({_x == "smokeshell"} count (magazines player)==0) : player globalChat "got smoke?"

right?
« Last Edit: 17 Jun 2003, 21:59:47 by MI_Fred »
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.

Ace

  • Guest
Re:Check if unit has smoke shells left?
« Reply #3 on: 17 Jun 2003, 23:56:46 »
Quote
?(MyGuy ammo "M16" == 0):aP sidechat "Reload d**n it!"

?(MyGuy ammo "Smokeshell" >= 1):aP sidechat "I have smoke"
He's right it won't work.

But if the unit doesn't have anything elso to throw you can right:
?(MyGuy ammo "Throw" >= 1):aP sidechat "I have smoke"
« Last Edit: 18 Jun 2003, 00:03:27 by Ace »