SA-MP Forums Archive
dini_Set - 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: dini_Set (/showthread.php?tid=116799)



dini_Set - Mike Garber - 30.12.2009

How can I set something to count +1 in the scriptfile?
Like;
pawn Код:
dini_Set("scriptfile.txt", file,+1);
That wont compile, but you get my point.

pawn Код:
dini_Set("scriptfile.txt", file,"+1");
This will compile, ofcourse, but It sets It to "+1" and doesn't count +1.



Re: dini_Set - LarzI - 30.12.2009

pawn Код:
dini_Int("scriptfile.txt", file) + 1
?


Re: dini_Set - Mike Garber - 30.12.2009

Quote:
Originally Posted by lrZ^ aka LarzI
pawn Код:
dini_Int("scriptfile.txt", file) + 1
?
That makes no sense.
I don't want dini_Int, I want to use dini_Set


Re: dini_Set - Mike Garber - 30.12.2009

pawn Код:
new playerid;
    new newvalue[10];
    new currentvalue[128];
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    currentvalue=dini_Get("scriptfile.txt", playername); // Line 1077
    format(newvalue, sizeof(newvalue), "%d",currentvalue+1);
    dini_Set("scriptfile.txt", playername,newvalue);
This will give me this error;
Код:
(1077) : error 047: array sizes do not match, or destination array is too small
(1078) : error 033: array must be indexed (variable "currentvalue")
:O what's this?



Re: dini_Set - LarzI - 30.12.2009

What are you trying to do anyway?
You are formatting a string with a string as a value? :S O_O

And btw I meant dini_Get instead of dini_Int, my bad...


Re: dini_Set - MadeMan - 30.12.2009

If the values are numbers then:

pawn Код:
dini_SetInt("scriptfile.txt", file, dini_Int("scriptfile.txt", file)+1);



Re: dini_Set - Mike Garber - 30.12.2009

Quote:
Originally Posted by MadeMan
If the values are numbers then:

pawn Код:
dini_SetInt("scriptfile.txt", file, dini_Int("scriptfile.txt", file)+1);
Oh? But It says It's undefined, even though I've got the dini include.


Re: dini_Set - MadeMan - 30.12.2009

Quote:
Originally Posted by mavtias
Quote:
Originally Posted by MadeMan
If the values are numbers then:

pawn Код:
dini_SetInt("scriptfile.txt", file, dini_Int("scriptfile.txt", file)+1);
Oh? But It says It's undefined, even though I've got the dini include.
Sorry, it's dini_IntSet


Re: dini_Set - Mike Garber - 30.12.2009

Isn't working...
I've set a timer to have the value to +1 every second, (as test, wont have it every second later) but It aint changing.


Re: dini_Set - MadeMan - 30.12.2009

Show your line.