Player.Skin

From Vice City Multiplayer
Jump to navigation Jump to search

This method can be used to get a player's skin or set to a desired one

Syntax

Type 1 - Getting the current skin a player has

PlayerInstance.Skin

Arguments

  • None

Returns

  • Integer - An integer representing the skin ID player is having

Type 2 - Setting a player's skin to desired one

PlayerInstance.Skin = skin

Arguments

  • integer skin id - The skin ID you would want to set for the player

Example

The following snippet will tell the player what skin id he is using

function onPlayerCommand(player, command, arguments) {
    if( command == "myskin" ) {
        MessagePlayer( "Your skin ID is: " + player.Skin, player );
    }
}

The following will set the player's skin to the ID given

function onPlayerCommand(player, command, arguments) {
    if( command == "skin" ) {
        if( !text ) return MessagePlayer( "Syntax: /skin [ID]", player );
        else if( !IsNum( text ) ) return MessagePlayer( "Skin ID must be an integer", player );
        else {
        player.Skin = text.tointeger();
        MessagePlayer( "Your skin ID is: " + player.Skin, player );
        }
    }
}

Related Functions

Player Game Functions

These functions exist for compatibility with the R2 Squirrel server.