Player.WeaponState

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

This function returns the state of the weapon the player is currently holding. (e.g. reloading)

Syntax

  1. int player.WeaponState
  • State 0 - Idle weapon
  • State 1 - Firing weapon
  • State 2 - Reloading weapon

Arguments

  • none

Example

This will tell the player what their weapon is currently doing when type '/wepstate'

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