13.08.2011, 14:36
I don't know whats the problem, I think I'm doing everything right. I use Pawn's raw file processor. When I register a account in my script, I'm given skin id 240, I use a command to change my skin to 239, I quit, and log back in, my skin is 239, just as it should be. After that, here's the problem, when I do /kill to change back to the old skin 240 (/kill - 240 is the only skin added in AddPlayerClass) and after my skin is set to 240 after death, logout again, I log in only to see that my skin id is 239. I don't know whats the problem, I've searched everywhere, tried almost everything but can't find the solution. But I deeply suspect that there is something wrong in 'SaveAccount'. Here is the scripts I have in my gamemode.
pawn Код:
public SaveAccount(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerLogged[playerid])
{
new string[30];
GetPlayerName(playerid, string, sizeof(string));
format(string, sizeof(string), "%s.ini", string);
new File: hFile = fopen(string, io_write);
if (hFile)
{
PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
format(string, sizeof(string), "Skin=%d\n",PlayerInfo[playerid][pSkin]);fwrite(hFile, string);
fclose(hFile);
}
}
}
return 1;
}