All pastes #674607 Raw Edit

Load And Save System

public text v1 · immutable
#674607 ·published 2007-08-29 12:06 UTC
rendered paste body
forward LoadProfile(playerid)
forward SaveProfile(playerid)

public LoadProfile(playerid)
{
			new Money[256];
			new Respect1[256];
			new Kills[256];
			new Deaths[256];
			new Warnings[256];
			new Wantedlvl[256];
			new Profilename[256];

			format(Profilename, sizeof(Profilename),"xadmin/Users/%s.ini",Player(playerid));

			Money[playerid] = dini_Int(stringS,"Cash");
			Level[playerid] = dini_Int(stringS,"Level");
			Respect[playerid] = dini_Int(stringS,"Respect");
			Kills[playerid] = dini_Int(stringS,"Kills");
			Deaths[playerid] = dini_Int(stringS,"Deaths");
			Wantedlvl[playerid] = dini_Int(stringS,"Wanted");
			Cop[playerid] = dini_Int(stringS,"Cop");
			TaxiDriver[playerid] = dini_Int(stringS,"Taxidriver");
			
			SendClientMessage(playerid, COLOR_GREY, "* Your Profile has been loaded.")
}

public SaveProfile(playerid)
{
			new Money[256];
			new Respect1[256];
			new Kills[256];
			new Deaths[256];
			new Warnings[256];
			new Wantedlvl[256];
			new Profilename[256];

			format(Profilename, sizeof(Profilename),"xadmin/Users/%s.ini",Player(playerid));
			
			//Getting Info
			Money[playerid] = GetPlayerMoney(playerid);
			Wanted[playerid] = GetPlayerWantedLevel(playerid);
			
			//Saving Info
			dini_IntSet(stringS,"Cash",Money[playerid]);
			dini_IntSet(stringS,"Respect",Respect[playerid]);
			dini_IntSet(stringS,"Kills",Kills[playerid]);
			dini_IntSet(stringS,"Deaths",Deaths[playerid]);
			dini_IntSet(stringS,"Wanted",Wanted[playerid]);
			dini_IntSet(stringS,"Jailed",Jailed[playerid]);
			
			SendClientMessage(playerid, COLOR_GREY, "* Your Profile has been saved.")
}