Posts: 1,506
Threads: 69
Joined: Feb 2008
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.
Posts: 1,506
Threads: 69
Joined: Feb 2008
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
Posts: 1,506
Threads: 69
Joined: Feb 2008
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?
Posts: 2,628
Threads: 32
Joined: Apr 2007
Reputation:
0
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...
Posts: 1,506
Threads: 69
Joined: Feb 2008
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.
Posts: 1,506
Threads: 69
Joined: Feb 2008
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.