Too Many Variables? - 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)
+--- Thread: Too Many Variables? (
/showthread.php?tid=293045)
Too Many Variables? -
jonrb - 26.10.2011
Hello all,
I'm encountering a strange kind of bug with my code.
Code:
Код:
new Float:sx,Float:sy,Float:sz;
new Float:p_money;
sscanf(qry,"p|iifiiifff",
pStats[playerid][atype],
pStats[playerid][faction],
p_money,
pStats[playerid][v1],
pStats[playerid][v2],
pStats[playerid][kills],
sx,
sy,
sz);
Note: Money is meant to be a float, I'm using decimal currency.
Anyway, when I change "new p_money;" to "new Float:p_money;", the compiler crashes when I press compile.
Even more strangely, it compiles fine when I use the "-r" parameter while compiling (Using pawn.cfg to specify parameters, as mentioned
here).
Can anybody help me?
Thanks in advance,
JonRB
Re: Too Many Variables? -
jonrb - 27.10.2011
Update:
I have just found that this problem isn't limited to just that script - A lot of my scripts now have issues with the compiler. It seems to happen when I add a variable but I'm sure there are plenty of other reasons for which it would stop working. Thankfully using the '-r' parameter still produces a valid script.
Re: Too Many Variables? -
spd_sahil - 27.10.2011
idk .. maybe im being blonde
Re: Too Many Variables? -
Ash. - 27.10.2011
Quote:
Originally Posted by spd_sahil
idk .. maybe im being blonde
|
That is already 'done' when you include the a_samp.inc file. Aside from that, the original issue, seems strange. I'm glad the OP has found a solution though! (Though, that doesn't explain why he had issues in the first place...)
Re: Too Many Variables? -
jonrb - 27.10.2011
I wouldn't really call it a solution, more of a substitute.
If anybody knows why (****** probably does...) I would really appreciate the help!
I found that it's seemingly random - I can add an entire new function and it works fine, but one change in variable type somewhere else and the compiler goes wrong - even with my 'fix'