dini_Set
#1

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.
Reply
#2

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

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

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?
Reply
#5

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...
Reply
#6

If the values are numbers then:

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

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

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

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.
Reply
#10

Show your line.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)