10.01.2011, 14:28
I'm wanting to to save peoples position after they logout and instead of returning to the class selection they will spawn in there skin, how would i do that?
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));
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);
}
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;
}