<aside> ⚡ script "core_CanGainAmmo" (int any)

</aside>

Usage


Checks if the calling player can gain ammo for either of their weapon’s (or weapons’) ammo types.

<aside> 🚨 The result of this script is only meaningful for weapons defined using [DefineWeapon](<https://mm8bdm.notion.site/DefineWeapon-6a4db7e06fb0415e8f80c3407c378ff8>)! Refrain from calling this script in scenarios where the player’s current weapon is not defined to avoid getting solely false / garbage results.

</aside>

Parameters

Return Value

Returns true if the player can gain ammo, false otherwise.

Example


W Tank and M Tanks both use this script in their Use state to prevent usage unless the player can actually gain ammo.

// W Tank
Use:
	TNT1 A 0 A_JumpIf(CallACS("core_CanGainAmmo"),"Success")
	fail
...
// M Tank
Use:
	TNT1 A 0 A_JumpIf(CallACS("core_CanGainAmmo",true) || CallACS("core_CanGainHealth"),"Success")
	fail

See Also


core_getweaponammo

core_getweaponammo2

core_getweaponammocapacity

core_getweaponammo2capacity