AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   error help (https://forums.alliedmods.net/showthread.php?t=204025)

RafalB. 12-26-2012 15:58

error help
 
PHP Code:

L 12/26/2012 11:06:33: [AMXXDisplaying debug trace (plugin "expmodsql.amxx")
L 12/26/2012 11:06:34: [AMXXRun time error 4index out of bounds 
L 12
/26/2012 11:06:34: [AMXX]    [0expmodsqlzname.sma::forward_PlayerPreThink (line 366

Code:
PHP Code:

public forward_PlayerPreThink(id)
{
    if(
is_user_connected(id) && is_user_alive(id) && !is_user_bot(id) && id != 0) {
        
pev(idpev_flFallVelocityfalling_speed[id]);
        new 
text[512];
        
        
format(text,511,"Poziom: %i/50 | Doswiadczenie: %d/%d (+%d)",PlayerLevel[id],exp[id],LEVELS[PlayerLevel[id]], LEVELS[PlayerLevel[id]] - exp[id]);
        
message_begin(MSG_ONEgmsgStatusText,{0,0,0}, id); 
        
write_byte(0); 
        
write_string(text);
        
message_end();
        return;
    } 


Podarok 12-26-2012 18:05

Re: error help
 
Post the full code here!

RafalB. 12-26-2012 18:17

Re: error help
 
why ? this error is this code, i will not post my full code becouse this is my exp mod for my serwer, sorry me english is weak.

Sylwester 12-26-2012 20:02

Re: error help
 
Then debug it yourself. We can't fix it if you post only that part.

fysiks 12-26-2012 20:59

Re: error help
 
Also, you didn't post the full error. You are missing the first line.

AngeIII 12-27-2012 11:15

Re: error help
 
check your arrays sizes.

falling_speed[id], PlayerLevel[id],exp[id],LEVELS[PlayerLevel[id]], LEVELS[PlayerLevel[id]] - exp[id]
some of them is wrong.
you try to call cell number Y but array size is X and Y>=X (last index number of array X is X-1), array[32]=first index 0 last 31.


fysiks 12-27-2012 20:55

Re: error help
 
Quote:

Originally Posted by AngeIII (Post 1861239)
check your arrays sizes.

falling_speed[id], PlayerLevel[id],exp[id],LEVELS[PlayerLevel[id]], LEVELS[PlayerLevel[id]] - exp[id]
some of them is wrong.
you try to call cell number Y but array size is X and Y>=X (last index number of array X is X-1), array[32]=first index 0 last 31.


Array sizes are not likely the issue (meaning making the array bigger won't fix the issue). He needs to prevent indexing arrays with values larger than the size of the array.

Because it's not this simple, we need the WHOLE code.

RafalB. 12-29-2012 04:54

Re: error help
 
thx, repaired ;>


All times are GMT -4. The time now is 13:44.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.