SA-MP Forums Archive
ReturnNextunused..... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: ReturnNextunused..... (/showthread.php?tid=200398)



ReturnNextunused..... - introzen - 18.12.2010

Hello. I've made this:

pawn Код:
stock ReturnNextUnusedBankID()
{
    new bank[64];
    for(new b=0; b<=MAX_BANKS; b++){
    format(bank, sizeof(bank), "CLRP/Banks/%d", b);
    if(!dini_Exists(bank)) return b; }
    return 1;
}
But I want it to start at 1000000000 and go upwards. How to?


Re: ReturnNextunused..... - Mauzen - 18.12.2010

Hm, like this?

pawn Код:
for(new b=1000000000; b<=MAX_BANKS + 1000000000; b++){



Re: ReturnNextunused..... - introzen - 18.12.2010

Yes but for some reason, the script always choose Bank ID 1

http://pastebin.com/ww8LHanf


Re: ReturnNextunused..... - introzen - 19.12.2010

bump


Re: ReturnNextunused..... - introzen - 19.12.2010

bump -.-


Re: ReturnNextunused..... - Joe Staff - 19.12.2010

Why not just add 1000000000 to'b' whenever you use it?


Re: ReturnNextunused..... - introzen - 19.12.2010

Quote:
Originally Posted by SilentHuntR
Посмотреть сообщение
Why not just add 1000000000 to'b' whenever you use it?
Thanks, worked.