SA-MP Forums Archive
strange variable change - 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: strange variable change (/showthread.php?tid=599257)



strange variable change - fordawinzz - 23.01.2016

how is it possible that a variable is getting random values (even negative) when only incrementing it by 1 every minute (timer) and it can get to 45 at best. I also reset it when timer is killed. WTF?

maybe timerfix plugin is causing this? ...


Re: strange variable change - Nero_3D - 23.01.2016

If something unexpected happens try to retrace the problem
For that you should print the value of the variable before and after you use it


Re: strange variable change - fordawinzz - 23.01.2016

yes, i've been thinking about the debug and I'll do it, but I don't know how this could happen


Re: strange variable change - PrO.GameR - 23.01.2016

Quote:
Originally Posted by fordawinzz
Посмотреть сообщение
how is it possible that a variable is getting random values (even negative) when only incrementing it by 1 every minute (timer) and it can get to 45 at best. I also reset it when timer is killed. WTF?

maybe timerfix plugin is causing this? ...
I'm almost 70% sure that it's the tag mismatch causing this, because last time I saw it, it was incrementing a float by 1, then asking it to act as integer. However, no one can give you a perfectly right answer unless we see the code.