argument type mismatch
#1

Код:
(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");
Reply
#2

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

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
Reply
#4

Yes, this should work
Reply
#5

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);
Reply
#6

bumpy
Reply
#7

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
Reply
#8

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

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)