Random vValue - 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: Random vValue (
/showthread.php?tid=607980)
Random vValue -
Nin9r - 26.05.2016
Hi there !
Some variables do not work properly but i don't know why. For example I have it:
new bag = 0;
When it is spawned i have bag = 1;
I am using if(bag == 0) to spawn a bag just if it is not spawned already.
After some time it is stuck. The variables remain on 0.
Another example:
I use TheRadio[MAX_PLAYERS] = 0; When a player is listening a radio station this variable gets a value 1,2,3,4,5 etc ( radio id ). I am using it to count how many listeners are for each radio station. After some time the variable remain on 0 ( i think ) because it doesn't count right.
Another example:
I have OnEvent = 0; When a player use /join to participate, I use OnEvent += 1; When I see how many players participate there is a wrong value. Sometime 89,28,38 even if is just 5-10 players. ( I use OnEvent = 0; on stopevent to reset i.)
Another:
A player gets a job and pJob] = 1,2,3,4,5... After spawning or entering in a vehicle the job disappear. I don't use pJob] = 0; anywhere.It is weird.
Some reasons for the variable problem?
Re: Random vValue -
Infinity - 26.05.2016
We'll have to see the code related to these issues. Guessing the problems with nothing to go on is kind of impossible.
Re: Random vValue -
Nin9r - 26.05.2016
Quote:
Originally Posted by Infinity
We'll have to see the code related to these issues. Guessing the problems with nothing to go on is kind of impossible.
|
It means to give you my entire gamemode. I am pretty sure that the problem is not appearing there. It is a global problem to all variables.
For example to event system i reset the variables to 0 when i create a event or when it is stopped. It has to count correct to next event but it doesn't.
Re: Random vValue -
Infinity - 26.05.2016
If it is not the gamemode, then what do you think it is? Cosmic rays?
Without code, we won't be able to help.
Re: Random vValue -
Nin9r - 26.05.2016
Quote:
Originally Posted by Infinity
If it is not the gamemode, then what do you think it is? Cosmic rays?
Without code, we won't be able to help.
|
So do you want to give the entire gamemode? The problem persist to all the variables on 60k lines. I asked you if you have any idea about it, I thought that some members know this problem and any solution like a plugin VariableFixer or something.
For example, do you know any cause why the job disappear? I searched for pJob] = 0; or pJob] = false; on it and i did not found anything. Why it is reset to 0 alone?