Array index is out of bounds
Hi my plugin give this log error :
Code:
L 01/23/2015 - 21:21:18: [SM] Plugin encountered error 15: Array index is out of boundsPHP Code:
|
Re: Array index is out of bounds
Which line is 1292?
|
Re: Array index is out of bounds
Assuming it is what I think it is, this is why I dislike IsValidClient stocks...
e.g. Their IsValidClient requires that attacker and victim be <= MaxClients so that hurts[victim] or vampiro[attacker] doesn't error later. |
Re: Array index is out of bounds
do victim-1 on hurts unless hurts is MAXPLAYERS+1
If that's the case, idk |
Re: Array index is out of bounds
Quote:
That, or at least allow try/catch statements in sourcepawn (which Voided said on a thread of mine that it's pending to come in a future sourcepawn version). Invalid client exceptions are one of the biggest pains in the ass with sourcemod that are annoying to circumvent. |
Re: Array index is out of bounds
Quote:
I made this stock for use in all my plugins a while ago, but even this will have places where something more specific is needed. |
Re: Array index is out of bounds
Use this stock:
PHP Code:
PHP Code:
|
Re: Array index is out of bounds
Quote:
But again, try/catch statements would also solve the problem if they existed in the first place. /irrelevant derailing that doesn't help the OP |
Re: Array index is out of bounds
Quote:
Some plugins require that the player be alive to be considered "valid" for a given operation. Others require only that the index pass an IsClientInGame check. Others require that the player be spectating. Etc. |
Re: Array index is out of bounds
@Dkmuniz Please also post your declarations for the global hurts[] and vampiro[]
|
| All times are GMT -4. The time now is 12:52. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.