SpawnClass.GetWeapon

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

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

Syntax

  1. int SpawnClass.GetWeapon( int iSlot )

Arguments

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

Example

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

This example will return the weapon 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.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox