<aside> ⚡ script "core_CanGainAmmo" (int any)
</aside>
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>
any
: bool - If this parameter is true, it will check if the calling player can gain ammo for any [DefineWeapon](<https://mm8bdm.notion.site/DefineWeapon-6a4db7e06fb0415e8f80c3407c378ff8>)
defined weapon which they own.Returns true if the player can gain ammo, false otherwise.
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