23.01.2014, 20:55
Hey guys,
I made this code that supposed to save automatically but it doesn't save it just say that it is..
Can someone help me to spot the problem ?
I made this code that supposed to save automatically but it doesn't save it just say that it is..
Can someone help me to spot the problem ?
pawn Код:
forward AutoSave(playerid);
public AutoSave(playerid)
{
printf("Saving Stats.");
SendClientMessageToAll(COLOR_RED, "Your stats were saved.");
if(fexist(UserPath(playerid)))
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]);
INI_WriteInt(File,"Respect",PlayerInfo[playerid][pExp]);
INI_WriteInt(File,"Sex",PlayerInfo[playerid][pSex]);
INI_WriteInt(File,"Age",PlayerInfo[playerid][pAge]);
INI_WriteInt(File,"Origin",PlayerInfo[playerid][pOrigin]);
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File,"Muted", PlayerInfo[playerid][pMuted]);
INI_WriteInt(File,"Int", PlayerInfo[playerid][pInt]);
INI_WriteInt(File,"Local", PlayerInfo[playerid][pLocal]);
INI_WriteInt(File,"VirWorld", PlayerInfo[playerid][pVirWorld]);
INI_WriteInt(File,"Model", PlayerInfo[playerid][pModel]);
INI_WriteFloat(File,"Health", PlayerInfo[playerid][pHealth]);
INI_WriteFloat(File,"Armour", PlayerInfo[playerid][pArmour]);
INI_WriteFloat(File,"X", PlayerInfo[playerid][pPosx]);
INI_WriteFloat(File,"Y", PlayerInfo[playerid][pPosy]);
INI_WriteFloat(File,"Z", PlayerInfo[playerid][pPosz]);
INI_WriteFloat(File,"A", PlayerInfo[playerid][pPosa]);
INI_WriteInt(File,"Weapon1",PlayerInfo[playerid][pW1]);
INI_WriteInt(File,"AmmuWeapon1",PlayerInfo[playerid][pWam1]);
INI_WriteInt(File,"Weapon2",PlayerInfo[playerid][pW2]);
INI_WriteInt(File,"AmmuWeapon2",PlayerInfo[playerid][pWam2]);
INI_WriteInt(File,"Weapon3",PlayerInfo[playerid][pW3]);
INI_WriteInt(File,"AmmuWeapon3",PlayerInfo[playerid][pWam3]);
INI_WriteInt(File,"Weapon4",PlayerInfo[playerid][pW4]);
INI_WriteInt(File,"AmmuWeapon4",PlayerInfo[playerid][pWam4]);
INI_WriteInt(File,"Weapon5",PlayerInfo[playerid][pW5]);
INI_WriteInt(File,"AmmuWeapon5",PlayerInfo[playerid][pWam5]);
INI_WriteInt(File,"Weapon6",PlayerInfo[playerid][pW6]);
INI_WriteInt(File,"AmmuWeapon6",PlayerInfo[playerid][pWam6]);
INI_WriteInt(File,"Weapon7",PlayerInfo[playerid][pW7]);
INI_WriteInt(File,"AmmuWeapon7",PlayerInfo[playerid][pWam7]);
INI_WriteInt(File,"Weapon8",PlayerInfo[playerid][pW8]);
INI_WriteInt(File,"AmmuWeapon8",PlayerInfo[playerid][pWam8]);
INI_WriteInt(File,"PhoneBook", PlayerInfo[playerid][pPhoneBook]);
INI_WriteInt(File, "Ph", PlayerInfo[playerid][pNumber]);
INI_WriteInt(File, "DrivingLicense", PlayerInfo[playerid][pDLicense]);
INI_WriteInt(File, "BikeLicense", PlayerInfo[playerid][pBLicense]);
INI_WriteInt(File, "GunLic", PlayerInfo[playerid][pGunLic]);
INI_WriteInt(File, "ConnectTime", PlayerInfo[playerid][pConnectTime]);
INI_WriteInt(File,"BankAccount", PlayerInfo[playerid][pAccount]);
INI_WriteInt(File,"Job", PlayerInfo[playerid][pJob]);
INI_WriteInt(File,"Mats", PlayerInfo[playerid][pMats]);
INI_WriteInt(File,"MiserPerk", PlayerInfo[playerid][pMiserPerk]);
INI_WriteInt(File,"PayCheck", PlayerInfo[playerid][pPayCheck]);
INI_WriteInt(File,"Fuel", PlayerInfo[playerid][pFuel]);
INI_WriteInt(File,"Weed",PlayerInfo[playerid][pWeed]);
INI_WriteInt(File,"DrugPerk",PlayerInfo[playerid][pDrugPerk]);
INI_WriteInt(File,"Cocaine",PlayerInfo[playerid][pCocaine]);
INI_WriteInt(File,"LSD",PlayerInfo[playerid][pLSD]);
INI_WriteInt(File,"Heroin",PlayerInfo[playerid][pHeroin]);
INI_WriteInt(File,"Morphine",PlayerInfo[playerid][pMorphine]);
INI_WriteInt(File,"Leader",PlayerInfo[playerid][pLeader]);
INI_WriteInt(File,"Member",PlayerInfo[playerid][pMember]);
INI_WriteInt(File,"Rank",PlayerInfo[playerid][pRank]);
INI_WriteInt(File,"index", PlayerInfo[playerid][pindex]);
INI_WriteInt(File,"modelid", PlayerInfo[playerid][pmodelid]);
INI_WriteInt(File,"boneid", PlayerInfo[playerid][pboneid]);
INI_WriteFloat(File,"fOffsetX", PlayerInfo[playerid][pfOffsetX]);
INI_WriteFloat(File,"fOffsetY", PlayerInfo[playerid][pfOffsetY]);
INI_WriteFloat(File,"fOffsetZ", PlayerInfo[playerid][pfOffsetZ]);
INI_WriteFloat(File,"fRotX", PlayerInfo[playerid][pfRotX]);
INI_WriteFloat(File,"fRotY", PlayerInfo[playerid][pfRotY]);
INI_WriteFloat(File,"fRotZ", PlayerInfo[playerid][pfRotZ]);
INI_WriteFloat(File,"fScaleX", PlayerInfo[playerid][pfScaleX]);
INI_WriteFloat(File,"fScaleY", PlayerInfo[playerid][pfScaleY]);
INI_WriteFloat(File,"fScaleZ", PlayerInfo[playerid][pfScaleZ]);
INI_WriteFloat(File,"Arrested", PlayerInfo[playerid][pArrested]);
INI_WriteFloat(File,"DrivWarn", PlayerInfo[playerid][pDrivWarn]);
INI_WriteFloat(File,"GenWarn", PlayerInfo[playerid][pGenWarn]);
INI_WriteFloat(File,"JailTime",PlayerInfo[playerid][pJailTime]);
INI_WriteFloat(File,"Jailed",PlayerInfo[playerid][pJailed]);
INI_WriteInt(File,"FirstPS", PlayerInfo[playerid][pFirstPS]);
INI_WriteInt(File,"Registed", PlayerInfo[playerid][pRegisted]);
INI_Close(File);
}
return 1;
}