15.11.2011, 17:25
if your trying to load the admin value thats not the way
you will need to perse the file then load it like this
and when you want to load the player level just use GetPlayerAVSAdmin(playerid);
you will need to perse the file then load it like this
pawn Код:
public GetPlayerAVSAdmin(playerid)
{
new name[MAX_PLAYER_NAME],file[80];GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"/%s.txt",name);//File location
if(fexist(file))
{
INI_ParseFile(file, "PerseAdminLevel", false, true, playerid, true, false);
PlayerInfo[playerid][pAdmin] = GetPVarInt(playerid, "Admin");//what ever you save it as in the file i used here "Admin"
}
}
//put this anywhere OUTSIDE a callback
forward PerseAdminLevel(playerid, name[], value[]);
public PerseAdminLevel(playerid, name[], value[])
{
if(!strcmp(name,"Admin"))SetPVarString(playerid,"Admin", value);
}