SA-MP Forums Archive
Crash detector is going crazy?! - 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: Crash detector is going crazy?! (/showthread.php?tid=352329)



Crash detector is going crazy?! - roleplay501 - 19.06.2012

What is wrong with this line?

GlobalPointPlayers[PlayerCapturing[playerid]]--;

It says that the array is out of bounds, but its not.

PlayerCapturing is defined MAX_PLAYERS
and GlobalPointPlayers is MAX_POINTS (the size is 10)

But im using this variable to check the current capturing point, Then its

PlayerCapturing = Pointid < 10; (Then its never higher than MAX_POINTS).
When im not capturing its INVALID_POINT which is 65534

Seems like this is to problem but its impossible since when im entering the CP the PlayerCapturing changes to Point id,
and When im leaving the CP its becomes INVALID_POINT but firstly its uses the PlayerCapturing to wipe the other required point variables and then PlayerCapturing becomes INVALID_POINT.

Then i can't understand what causes to crashdetector to be crazy...


[17:00:19] [debug] #0 00022044 in public OnPlayerLeaveDynamicCP (playerid=0, checkpointid=1):1104 (.pwn)
[17:00:19] [debug] #1 native Streamer_CallbackHook ()
[17:00:19] [debug] #2 00007f9c in public OnPlayerLeaveCheckpoint (playerid=0) :474 (Streamer.inc)