[Y_ini Problem ] Nw its save!, but not loading for me :( help !
#1

Hi people, im having a loading stats problem , well not stats, loading skin!
When player disconnect it saves his skin in my user path normally but when he join he join with CJ skin!!!
any help? script below..
saving :
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
   new sID = GetPlayerSkin(playerid);
   new INI:File = INI_Open(UserPath(playerid));
   INI_SetTag(File,"Player's Skin");
   INI_WriteInt(File,"pSkin",sID);
   INI_Close(File);
}
and loading :
pawn Код:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("pSkin",PlayerInfo[playerid][pSkin]);
    return 1;
}
onplayerspawn :
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
    return 1;
}
Help me!!!!
Reply
#2

Where are you calling INI_ParseFile?
Reply
#3

i didnt help me how can i add?
Reply
#4

If you have a register system then call it when the player logs in, if not just try OnPlayerConnect instead.

pawn Код:
public OnPlayerConnect(playerid)
{
    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    return 1;
}
Reply
#5

Quote:
Originally Posted by Stinged
Посмотреть сообщение
If you have a register system then call it when the player logs in, if not just try OnPlayerConnect instead.

pawn Код:
public OnPlayerConnect(playerid)
{
    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    return 1;
}
WOW man!! its working now thank you so much i will give u credits in this project im workign on
Reply
#6

EDIT: k, i was slow now .-.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)