OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Black Operative 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! :)
-
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!"
-
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:
? ({_x == "smokeshell"} count (magazines player)==0) : player globalChat "got smoke?"
right? (http://www.ofpec.com/yabbse/YaBBImages/smilies/cool2.gif)
-
?(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"