15.08.2012, 15:31
Using
Код:
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
pawn Код:
enum PInfo
{
pDeaths,
pKills
pCash,
}
new PlayerInfo[MAX_PLAYERS][PInfo];
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("Kills",PlayerInfo[playerid][pKills]);
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
return 1;
}
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"/YOURPATH/%s.ini",playername);
return string;
}
public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid)))//Login
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
//And all other code