SA-MP Forums Archive
Help With Skins!! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help With Skins!! (/showthread.php?tid=318964)



Help With Skins!! - Finn707 - 17.02.2012

Hello, I need some help making it so the skin selection only appears on a players first login, meaning the server must remember a players skin when they disconnect. Also does anyone know how to make on of those server tutorials or guides for first time players on the server?


Re: Help With Skins!! - Madd Kat - 17.02.2012

just save the skin id to a ini file using y_ini or the likes.

then on player spawn set there skin.


Re: Help With Skins!! - TheGamer! - 17.02.2012

pawn Код:
new bool:Forced[MAX_PLAYERS]=false;

public OnPlayerRequestClass(playerid, classid)
{
    if(!Forced[playerid]) SpawnPlayer(playerid);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(!Forced[playerid])
    {
        if(dini_Exists("Skins.ini"))
        {
            new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME);
            SetPlayerSkin(playerid, dini_Int("Skins.ini", name));
        }
    }
    if(Forced[playerid])
    {
        if(!dini_Exists("Skins.ini")) dini_Create("Skins.ini");
        new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        dini_IntSet("Skins.ini", name, GetPlayerSkin(playerid));
    }
    return 1;
}
In the login command use
pawn Код:
ForcePlayerToClassSelection(playerid);
Forced[playerid]=true;