Help please
#2

use this code

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));
Under OnPlayerSpawn

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);
}
At the end

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;
}
Don't forget to edit \\skin\\ to your own filename
Reply


Messages In This Thread
Help please - by darkknight123 - 10.01.2011, 14:28
Re: Help please - by Mr.Stranger - 10.01.2011, 15:01

Forum Jump:


Users browsing this thread: 1 Guest(s)