Scripting/Squirrel/Functions/Players/Weapon
From VC-MP Wiki
This instance variable returns the weapon player has currently selected.
Syntax
int player.Weapon
Example
This command gives player the name of the weapon they are using when they type '/c mywep'.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "mywep" ) { MessagePlayer( "Your current weapon: " + GetWeaponName( player.Weapon ), player ); } }
Notes
The functions MessagePlayer, GetWeaponName and call onPlayerCommand were used in in this example. More info about them in corresponding pages.
Related Functions
- FindPlayer
- Player.Angle
- Player.Armour
- Player.Cash
- Player.Class
- Player.DrivebyAbility
- Player.GetSpectating
- Player.GetSyncBlockedTo
- Player.Health
- Player.ID
- Player.IP
- Player.IsAdmin
- Player.IsFrozen
- Player.IsIgnoredBy
- Player.IsMuted
- Player.IsPassenger
- Player.IsSpawned
- Player.IsSyncBlocked
- Player.IsWeaponSyncBlocked
- Player.Keys
- Player.Name
- Player.Ping
- Player.Pos
- Player.RemoveLocalMarker
- Player.RemoveMarker
- Player.ResetGameSettings
- Player.Score
- Player.Seat
- Player.SetAnim
- Player.SetDrunkLevel
- Player.SetIgnoredBy
- Player.SetInterior
- Player.SetLocalMarker
- Player.SetMarker
- Player.SetSyncBlockedTo
- Player.WantedLevel
- Player.SetWeapon
- Player.Skin
- Player.SpawnPos
- Player.Team
- Player.Vehicle
- Player.Weapon
- Player.ShootInAir
- Player.StuntMode
- Player.Spikes
