Problem with foreach/iterator : array index out of bonus
#1

So, when a player give damage (OnPlayerGiveDamge) I search for spectate admins to see how many damage he gives, just a simple message format.. I don't know what's wrong..

OnPlayerGiveDamage: https://pastebin.com/Tfan0y03 (I showed the line in pastebin)

I tested without iterator Admins and changed to Player, and still give me errors..

The problem is that, sometimes give me error and server crash, sometimes everying works fine, without errors in server_log and without crash.

Bdw, i have too many errors in server_log and the server crash..showing the wrong line (I think, because /freeze is a simple command, see below).

/freeze command: https://pastebin.com/jrJ8QKbh

server_log: https://pastebin.com/rSt4QZcv
Reply
#2

bump
Reply
#3

have you try using "crashdetect" plugin?
Reply
#4

Quote:
Originally Posted by CoaPsyFactor
Посмотреть сообщение
have you try using "crashdetect" plugin?
I have already crashdetect plugin...all information that are, are in in the pastebin above..
Reply
#5

Show the defining of Spectate and the ShowDMG arrays.
Reply
#6

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Show the defining of Spectate and the ShowDMG arrays.
https://pastebin.com/8x5zSwzp
Reply
#7

That's not what I said... Show the DEFINITION of those ARRAYS.... Not the implementation.

On a side note, you don't need a string 500 long to display information that's likely to not even break 140.
Reply
#8

It explains itself. You're attempting to access something illegally.
Reply
#9

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
That's not what I said... Show the DEFINITION of those ARRAYS.... Not the implementation.

On a side note, you don't need a string 500 long to display information that's likely to not even break 140.
You mean this?

Код:
new Spectate[MAX_PLAYERS],
    ShowDMG[MAX_PLAYERS];
Reply
#10

It'd be easier if this error came from OnPlayerTakeDamage as that'd usually be an issue with not checking for INVALID_PLAYER_ID.


But this does seem interesting as to why it really would bug out on that area.

If you haven't been using -d3 in your compiler options as CrashDetect requires, I'd suggest you sort that out and get an updated crashlog.

Quote:
Originally Posted by None1337
Посмотреть сообщение
You mean this?

Код:
new Spectate[MAX_PLAYERS],
    ShowDMG[MAX_PLAYERS];
Yes, that is the definition of the array. Implementation is where you use it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)