SA-MP Forums Archive
argument type mismatch - 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: argument type mismatch (/showthread.php?tid=178465)



argument type mismatch - Seven. - 22.09.2010

Код:
(376) : error 035: argument type mismatch (argument 3)
(377) : error 035: argument type mismatch (argument 3)
pawn Код:
dini_IntSet("hood.ini", "gCounting[0]", "00");
    dini_IntSet("hood.ini", "gCounting[1]", "00");



Re: argument type mismatch - Mauzen - 22.09.2010

You want to set an int, so do it
The last parameter needs to be an integer, not a string


Re: argument type mismatch - Seven. - 22.09.2010

pawn Код:
dini_IntSet("highb.ini", "gCounting[0]", gCounting[0]);
    dini_IntSet("highb.ini", "gCounting[1]", gCounting[1]);
Like this? It's giving no error now . I'm not very good with dini lol


Re: argument type mismatch - Mauzen - 22.09.2010

Yes, this should work


Re: argument type mismatch - Seven. - 22.09.2010

When a player finishes, it's not setting anything in highdb.ini, just a empty file :S
pawn Код:
if(gCounting[0] < dini_Int("highb.ini", "gCounting[0]")) return 1;
            if(gCounting[0] == dini_Int("highb.ini", "gCounting[0]")) if(gCounting[1] < dini_Int("highb.ini", "gCounting[1]")) return 1;
            dini_IntSet("highb.ini", "gCounting[0]", gCounting[0]);
            dini_IntSet("highb.ini", "gCounting[1]", gCounting[1]);
            format(str, sizeof(str), "[NEW RECORD]%s(id: %d) has set a new race record of: %02d:%02d", gPlayerName,playerid, gCounting[0], gCounting[1]);
            SendClientMessageToAll(rose, str);



Re: argument type mismatch - Seven. - 23.09.2010

bumpy


Re: argument type mismatch - Mauzen - 23.09.2010

If I understand your code correctly, you have the players time in gCounting[0/1] and want to check, if this is shorter than the time stored in the file.
But in this line (also in the next one)

if(gCounting[0] < dini_Int("highb.ini", "gCounting[0]")) return 1;

you return 1 and end the function if it is shorter, so the players time would need to be longer than the saved record.
Swap < with > then. But maybe it is correct that way, if a longer time is better


Re: argument type mismatch - Seven. - 23.09.2010

Ok but, it's not writing anything in the file to.. :S


Re: argument type mismatch - Mauzen - 23.09.2010

Try setting the values by hand the first time:
gCounting[0]=99999
gCounting[1]=99999
If there is nothing, dini_Int returns 0 i think, and time can be shorter than 0 seconds, so it does not write