Quote:
Originally Posted by Norck
I haven't tested it, but it should work:
pawn Код:
bool:LoadTax() // load TotalTaxPaid 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)); TotalTaxPaid = strval(str); fclose(aFile); return true; }
bool:SaveTax() // save TotalTaxPaid 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",TotalTaxPaid); fwrite(aFile,str); fclose(aFile); return true; }
|
EDIT: just mixed some var names