Player.WeaponAmmo

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function returns the ammo of the weapon the player is currently holding.

Syntax

  1. int player.WeaponAmmo

Arguments

  • none

Example

This will tell the player how much ammo they currently have remaining when they type '/ammo'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "ammo" )
  5. {
  6. MessagePlayer( "Your current weapon ammo is - " + pPlayer.WeaponAmmo, pPlayer );
  7. }
  8. return 1;
  9. }
  10.  

Notes

The function MessagePlayer and event onPlayerCommand were used in this example. More info about them in the corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox