Scripting/Squirrel/Functions/Players/Skin
From VC-MP Wiki
NOTE: This function has been modified in VC:MP 0.3z r2. It may work as in previous versions, and offer additional functionality.
This instance variable returns or sets the skin player is using. Note: Since R2 it's been possible to set the player skin as well.
Syntax
int Player.Skin Player.Skin = int iNewSkin
Example 1. Returning
This command gives player the skin ID they are using when they type '/c skin'.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "skin" ) { MessagePlayer( "Your current skin: " + GetSkinName( player.Skin ), player ); } }
Notes
The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in corresponding pages.
Example 2. Setting
This command sets the player skin when they type '/c setskin SkinID'.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "setskin" ) { if ( IsNum( text ) ) { player.Skin = text.tointeger(); MessagePlayer( "Your current skin: " + GetSkinName( player.Skin ), player ); } else { MessagePlayer( "Syntax error! Please type: /c setskin SkinID" , player ); } } }
Notes
The functions MessagePlayer, GetSkinName, IsNum, tointeger() and call onPlayerCommand were used in in this example. More info about them in corresponding pages.
List of skins: SkinIDs.
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
