10.01.2011, 15:01
use this code
Under OnPlayerDisconnect
Under OnPlayerSpawn
At the end
Don't forget to edit \\skin\\ to your own filename
Under OnPlayerDisconnect
pawn Код:
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\skin\\%s.ini", pname);//skin will be the name of your folder in scriptfiles
if(!dini_Exists(file))
dini_Create(file);
dini_IntSet(file, "skin", GetPlayerSkin(playerid));
pawn Код:
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\skin\\%s.ini", pname);
if(dini_Exists(file))
{
SetTimerEx("SpawnSave", 100, false, "d", playerid);
}
pawn Код:
forward SkinSave(playerid);
public SkinSave(playerid)
{
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\skin\\%s.ini", pname);
SetPlayerSkin(playerid, dini_Int(file, "skin"));
return 1;
}