28.10.2011, 09:41
i had to go offline :\
ok so now that you have replaced the script i told you now where ever you want to load the players date put this
ok so now that you have replaced the script i told you now where ever you want to load the players date put this
pawn Code:
new name[MAX_PLAYER_NAME],file[80];GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"/THE LOCATION OF THE SAVE FILE/%s.txt",name);//NOTE: make sure to change the location
INI_ParseFile(file, "LoadUser_data", false, true, playerid, true, false);//This will perse the files!
//Now to laod them do this
LoadPlayerData(playerid);//you put this after the date has been persed
//Now put this callback at teh botttom of your script!
forward LoadPlayerData(playerid);
public LoadPlayerData(playerid)
{
new name[MAX_PLAYER_NAME],file[80];GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"/THE LOCATION OF THE SAVE FILE/%s.txt",name);//NOTE: make sure to change the location
if(fexist(file))
{
PlayerInfo[playerid][LEVEL] = GetPVarInt(playerid, "Level");
PlayerInfo[playerid][ADMINLEVEL] = GetPVarInt(playerid, "Admin Level");
PlayerInfo[playerid][WIRED] = GetPVarInt(playerid, "Wired");
PlayerInfo[playerid][JAILED] = GetPVarInt(playerid, "Jailed");
PlayerInfo[playerid][JOB] = GetPVarInt(playerid, "Job");
PlayerInfo[playerid][FACTION] = GetPVarInt(playerid, "Faction");
PlayerInfo[playerid][CAR] = GetPVarInt(playerid, "Car");
PlayerInfo[playerid][PHONE] = GetPVarInt(playerid, "Phone");
PlayerInfo[playerid][PHONEBOOK] = GetPVarInt(playerid, "Phonebook");
PlayerInfo[playerid][MASK] = GetPVarInt(playerid, "Mask");
PlayerInfo[playerid][CONDOM] = GetPVarInt(playerid, "Condom");
PlayerInfo[playerid][GUNSKILL] = GetPVarInt(playerid, "Gun Skill");
PlayerInfo[playerid][JOBSKILL] = GetPVarInt(playerid, "Job Skill");
PlayerInfo[playerid][CARLIC] = GetPVarInt(playerid, "CarLic");
PlayerInfo[playerid][FLYLIC] = GetPVarInt(playerid, "FlyLic");
PlayerInfo[playerid][GUNLIC] = GetPVarInt(playerid, "GunLic");
PlayerInfo[playerid][FACRANK] = GetPVarInt(playerid, "FacRank");
GivePlayerMoney(playerid,GetPVarInt(playerid, "Money"));
}
}
return 1;
}