Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Random vValue

$
0
0
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?

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>