Player.Skin

From Vice City Multiplayer
Revision as of 05:59, 14 July 2016 by Xmair (talk | contribs) (→‎Example)
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing

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 );
        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.