24.07.2011, 14:20
When im in the game everything in the file saves.... but when i reloggin everything its set to 0 any help on why this could be?
public SaveStats(playerid) { for(playerid=0;playerid<MAX_PLAYERS;playerid++) { if(INI_Open(getINI(playerid))) { SendClientMessage(playerid, COLOUR_YELLOW, "SAVED!"); new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a); //INI_WriteInt("Age",PlayerInfo[playerid][Age]); INI_WriteInt("Cash", GetPlayerMoney(playerid)); INI_WriteInt("Score", GetPlayerScore(playerid)); INI_WriteInt("Skin",GetPlayerSkin(playerid)); INI_WriteInt("Kills", killer[playerid]); INI_WriteInt("Deaths", died[playerid]); //INI_WriteInt("Hospital", PlayerInfo[playerid][Hospital]); //INI_WriteInt("Timepalyed",PlayerInfo[playerid][Timeplayed]); //INI_WriteString("Ipaddress",PlayerInfo[playerid][Ipaddress]); INI_WriteFloat("Savedpositionx", x); INI_WriteFloat("Savedpositiony", y); INI_WriteFloat("Savedpositionz", z); INI_WriteFloat("Savedpositiona", a); INI_WriteInt("playersInterior", GetPlayerInterior(playerid)); INI_WriteInt("playersVworld", GetPlayerVirtualWorld(playerid)); INI_WriteInt("Admin",PlayerInfo[playerid][Admin]); INI_WriteInt("Faction",PlayerInfo[playerid][Faction]); INI_WriteInt("Factionrank",PlayerInfo[playerid][Factionrank]); //INI_WriteInt("Bankdeposit",PlayerInfo[playerid][Bankdeposit]); //INI_WriteInt("Banned",PlayerInfo[playerid][Banned]); //INI_WriteString("Banreason",PlayerInfo[playerid][Banreason]); //INI_WriteInt("House",PlayerInfo[playerid][House]); //INI_WriteInt("Biz",PlayerInfo[playerid][Biz]); //INI_WriteInt("Fightstyle",PlayerInfo[playerid][Fightstyle]); //INI_WriteInt("Walkstyle", PlayerInfo[playerid][Walkstyle]); //INI_WriteInt("TimesArrested", PlayerInfo[playerid][TimesArrested]); //INI_WriteInt("Drivinglicense", PlayerInfo[playerid][Drivinglicense]); //INI_WriteInt("Flyinglicense", PlayerInfo[playerid][Flyinglicense]); //INI_WriteInt("Boatlicense", PlayerInfo[playerid][Boatlicense]); //INI_WriteInt("GunLicense", PlayerInfo[playerid][Gunlicense]); //INI_WriteInt("Car", PlayerInfo[playerid][Car]); //INI_WriteInt("Job", PlayerInfo[playerid][Job]); //INI_WriteInt("Earnings", PlayerInfo[playerid][Earnings]); INI_Save(); INI_Close(); } } return 1; }
new
INI:ini = INI_Open("myini.ini");
INI_WriteString(ini, "NAME", "******");
INI_WriteInt(ini, "SCORE", gScore);
INI_WriteFloat(ini, "HEALTH", health);
INI_Close(ini);