A JumpIfInventory

From ECWolf Wiki

A_JumpIfInventory (string item, int amount, state frame)

The calling actor jumps to the specified state if the actor is carrying at least amount of the given item.

Example

actor ReloadingPistol : Pistol //A pistol that reloads every 8 shots. uses the "LoadPistol" actor.
{
	states
	{
		Fire:
			PISG A 0 A_JumpIfInventory("PistolFired", 8, "LoadPistol")
			PISG B 3
			PISG C 3 Bright
			PISG D 3 A_GunAttack
			PISG E 3 A_GiveInventory("PistolFired", 1)
			goto ready
		LoadPistol:
			PISG F 3 //Reloading frames
			PISG G 3
			PISG H 3 A_TakeInventory("PistolFired", 8)
			goto ready
	}
}