02.01.2012, 19:15
I haven't tested it, but it should work:
pawn Код:
bool:LoadTax() // load TotalTaxPays amount, use it in OnGameModeInit
{
new File:aFile = fopen("taxes.ini",io_read);
if(!aFile) return false;
new str[32];
fread(aFile,str,sizeof(str));
GlobalTaxPays = strval(str);
fclose(aFile);
return true;
}
bool:SaveTax() // save GlobalTaxPays amount, use it in OnGameModeExit
{
new File:aFile = fopen("taxes.ini",io_write);
if(!aFile) return false;
new str[32];
format(str,sizeof(str),"%d",GlobalTaxPays);
fwrite(aFile,str);
fclose(aFile);
return true;
}