Squirrel/Server/Functions/Players/WeaponState
From Liberty Unleashed Wiki
(Difference between revisions)
(→Syntax) |
(→Syntax) |
||
Line 6: | Line 6: | ||
<code>int player.WeaponState</code> | <code>int player.WeaponState</code> | ||
− | State 0 | + | * State 0 - Idle weapon |
− | State 1 | + | * State 1 - Firing weapon |
− | State 2 | + | * State 2 - Reloading weapon |
== Arguments == | == Arguments == |
Latest revision as of 19:30, 25 October 2010
This function returns the state of the weapon the player is currently holding. (e.g. reloading)
[edit] Syntax
int player.WeaponState
- State 0 - Idle weapon
- State 1 - Firing weapon
- State 2 - Reloading weapon
[edit] Arguments
- none
[edit] Example
This will tell the player what their weapon is currently doing when type '/wepstate'
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "wepstate" ) { MessagePlayer( "Your current weapon state is - " + pPlayer.WeaponState, pPlayer ); } return 1; }
[edit] Notes
The function MessagePlayer and event onPlayerCommand were used in this example. More info about them in the corresponding pages.
[edit] Related Functions
- FindPlayer
- GetClosestPlayer
- Player.Alpha
- Player.Angle
- Player.Armour
- Player.Cash
- Player.Class
- Player.ClearWeapons
- Player.Colour
- Player.ColouredName
- Player.EnterVehicle
- Player.ExitVehicle
- Player.ForceToSpawnScreen
- Player.Frozen
- Player.GetBoundariesLower
- Player.GetBoundariesUpper
- Player.GetIgnored
- Player.Health
- Player.ID
- Player.IP
- Player.Immune
- Player.Island
- Player.LUID
- Player.Marker
- Player.MarkerScale
- Player.MarkerSprite
- Player.Muted
- Player.Name
- Player.Nametag
- Player.NametagColour
- Player.Ping
- Player.Pos
- Player.RemoveFromVehicle
- Player.RemoveLimb
- Player.Score
- Player.SetAnim
- Player.SetBoundaries
- Player.SetIgnored
- Player.SetIgnoredBy
- Player.SetVehicleEnterDoor
- Player.SetWeapon
- Player.Skin
- Player.Spawn
- Player.Spawned
- Player.Team
- Player.Train
- Player.Vehicle
- Player.VehicleSeat
- Player.Velocity
- Player.VirtualWorld
- Player.WantedLevel
- Player.Weapon
- Player.SetWeapon
- Player.WeaponAmmo
- Player.WeaponState