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?