Player.Weapon

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

This function returns the weapon the player is currently holding.

Syntax

  1. int player.Weapon

Arguments

  • none

Example

This will tell the player the weapon ID of the currently equipped weapon when they type '/wep'

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "wep" )
  5. {
  6. MessagePlayer( "Your current weapon is - " + pPlayer.Weapon, 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