Little error
#1

So I have this error, I am trying to solve this, but I just cant.

pawn Код:
new price;
format(DCars[id][Price], 255, "%s", price);
dini_IntSet(filestring, "Price", DCars[id][Price]);
For example if I make the price ... 10000 and then i check in script files it will only show 2 - 3 numbers and they will be completely different.

And when a 3d text label is there it shows random things .. I just dont know how to fix it..

Please help

Thanks
Reply
#2

Код:
format(DCars[id][Price], 10, "%d", price);
Otherwise,
Код:
DCars[id][Price] = price;
Assuming that the variable 'price' is in digit form, not string form.
Reply
#3

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
Код:
format(DCars[id][Price], 10, "%d", price);
Otherwise,
Код:
DCars[id][Price] = price;
Assuming that the variable 'price' is in digit form, not string form.
Still did not work

Please help

Thanks
Reply
#4

Because you're saving an integer as a string, on this line:

pawn Код:
dini_IntSet(filestring, "Price", DCars[id][Price]);
Change it to

pawn Код:
dini_IntSet(file, "Price", DCars[id][Price]);
Reply
#5

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)