Squirrel/Server/Functions/SpawnClass/GetWeaponAmmo

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
 
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|SpawnClass.GetWeaponAmmo}}
 
This function returns the spawn weapon ammo in the given slot for a ''SpawnClass''.
 
This function returns the spawn weapon ammo in the given slot for a ''SpawnClass''.
  

Latest revision as of 10:37, 11 October 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function returns the spawn weapon ammo in the given slot for a SpawnClass.

[edit] Syntax

  1. int SpawnClass.GetWeaponAmmo( int iSlot )

[edit] Arguments

  • iSlot - The slot you want to retrieve the weapon ammo for. There are three slots available: 1, 2 and 3

[edit] Example

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "getammo" )
  5. {
  6. local wepammo = p_SpawnClass.GetWeaponAmmo( 1 );
  7. MessagePlayer( "The current wep ammo in slot one is: " + wepammo, player );
  8. }
  9. }
  10.  

This example will return the weapon ammo in slot 1 of the spawn class, that we found earlier in FindSpawnClass.

[edit] Notes

The call onPlayerCommand was used in in this example. More info about this in the corresponding page.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox