SpawnClass.GetWeaponAmmo
From Liberty Unleashed Wiki
This function returns the spawn weapon ammo in the given slot for a SpawnClass.
Syntax
int SpawnClass.GetWeaponAmmo( int iSlot )
Arguments
- iSlot - The slot you want to retrieve the weapon ammo for. There are three slots available: 1, 2 and 3
Example
function onPlayerCommand( player, cmd, text ) { if ( cmd == "getammo" ) { local wepammo = p_SpawnClass.GetWeaponAmmo( 1 ); MessagePlayer( "The current wep ammo in slot one is: " + wepammo, player ); } }
This example will return the weapon ammo in slot 1 of the spawn class, that we found earlier in FindSpawnClass.
Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.