skin help - always spawn as cj skin
#3

Quote:
Originally Posted by HY
Посмотреть сообщение
pawn Код:
#define PATH "/Skins/%s.ini"

//Enums
enum sInfo
{
    Skin
}
new SkinInfo[MAX_PLAYERS][sInfo];

forward LoadUser_data(playerid,name[],value[]);

public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Skin",SkinInfo[playerid][Skinl]);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Skin",SkinInfo[playerid][Skin]);
    INI_Close(File);
    return 1;
}

public OnPlayerConnect(playerid)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Skin",0);
    INI_Close(File);
    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerSkin(playerid, SkinInfo[playerid][Skin]);
    return 1;
}


stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}
Hi dear, thanks for the help but I already have mysql saving system it is better. and I wanted to know why and where I can find the problem.

EDIT: Well after trying so hard to figure out why it turns to Cj skin. I found that the skin value change to 0 under onplayerconnect. Can you please help me with this?
Reply


Messages In This Thread
skin help - always spawn as cj skin - by kbalor - 08.12.2014, 17:39
Re: skin help - always spawn as cj skin - by HY - 08.12.2014, 17:46
Re: skin help - always spawn as cj skin - by kbalor - 08.12.2014, 17:48
Re: skin help - always spawn as cj skin - by Cypress - 08.12.2014, 18:32
Re: skin help - always spawn as cj skin - by kbalor - 08.12.2014, 18:49
Re: skin help - always spawn as cj skin - by Cypress - 10.12.2014, 19:23

Forum Jump:


Users browsing this thread: 2 Guest(s)