SetPlayerSkin

From SA-MP Wiki

Jump to: navigation, search

SetPlayerSkin


The SetPlayerSkin function is meant to change the skin of a player into another one. This function can be used on every moment, rather then SetSpawnInfo which needs to be called prior to the player spawning. A number of bugs related to this function have been fixed in SA-MP 0.2.


Important note: The following Skin IDs crash the game for the player: 3, 4, 5, 6, 7, 8, 42, 65, 74, 86, 119, 149, 208, 268, 273 and 289.


Parameters:
(playerid, skinid)
playeridThe player of who you want to change the skin of.
skinidThe skin which you want the player to have.
This function does not return a specific value, it's best to simply ignore it.


public OnPlayerCommandText( playerid, cmdtext[] )
{
    if( strcmp( cmdtext, "/myskin", true) == 0 )
    {
        // Update the player's skin to ID 277, a fire-fighter. Not all skins can
        // be used here, check the skin-page for an overview.
        SetPlayerSkin( playerid, 277 );
        return 1;
    }
 
    // Command not handled
    return 0;
}

Related Functions

The following functions might be useful as well, as they're related to this function in one way or another.

In other languages