Help with taxes
#5

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
Reply


Messages In This Thread
Help with taxes - by Face9000 - 02.01.2012, 19:02
Re: Help with taxes - by Norck - 02.01.2012, 19:07
Re: Help with taxes - by Face9000 - 02.01.2012, 19:09
Re: Help with taxes - by Norck - 02.01.2012, 19:15
Re: Help with taxes - by Norck - 02.01.2012, 19:17
Re: Help with taxes - by Face9000 - 02.01.2012, 19:22

Forum Jump:


Users browsing this thread: 2 Guest(s)