AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Index out of bound (https://forums.alliedmods.net/showthread.php?t=141068)

edgaras85 10-19-2010 07:14

Index out of bound
 
PHP Code:

public join_team(id
{
        if (
get_user_flags(id) & ( ADMIN_KICK ADMIN_LEVEL_A )) 
    {
        
remove_task(id)
        return 
PLUGIN_CONTINUE
    
}
    
        new 
arg[2
        
read_argv(1arg1)
        [
code]if (blockjoining[str_to_num(arg)-1] == true)[/code]        {
                
engclient_cmd(id"chooseteam"
                return 
PLUGIN_HANDLED 
        

    
        return 
PLUGIN_CONTINUE 


in code Is 161 line

Quote:

L 10/16/2010 - 11:31:12: [AMXX] Displaying debug trace (plugin "teamlocker.amxx")
L 10/16/2010 - 11:31:12: [AMXX] Run time error 4: index out of bounds
L 10/16/2010 - 11:31:12: [AMXX] [0] teamlocker.sma::join_team (line 161)

Voi 10-19-2010 09:01

Re: Index out of bound
 
It would help a bit if you'd tell what is the 161 line :).

SaM.ThE.MaN 10-19-2010 09:25

Re: Index out of bound
 
post ur complete code if u want help

edgaras85 10-19-2010 11:52

Re: Index out of bound
 
PHP Code:

if (blockjoining[str_to_num(arg)-1] == true) { 

is 161 line

Quote:

post ur complete code if u want help
Its full function

mottzi 10-19-2010 11:55

Re: Index out of bound
 
wich is the line 161?

edgaras85 10-19-2010 12:08

Re: Index out of bound
 
Quote:

Originally Posted by mottzi (Post 1329434)
wich is the line 161?

I wrote in post above yours....

PHP Code:

if (blockjoining[str_to_num(arg)-1] == true


Xalus 10-19-2010 12:40

Re: Index out of bound
 
Just add:

is_user_connected ?

Mxnn 10-19-2010 12:54

Re: Index out of bound
 
May be because is ilogical. You have to think that if str_to_num(arg) is 0. The statement would be:
PHP Code:

if (blockjoining[0-1] == true

array[-1] is ilogical.

edgaras85 10-19-2010 12:55

Re: Index out of bound
 
Quote:

Originally Posted by Xalus (Post 1329458)
Just add:

is_user_connected ?

Thanks will try :)

Maybe you know why this error happened?
Quote:

L 10/09/2010 - 12:20:48: [AMXX] Displaying debug trace (plugin "use_button_once.amxx")
L 10/09/2010 - 12:20:48: [AMXX] Run time error 3: stack error
On other plugin :) Dont want to create other topic

Exolent[jNr] 10-19-2010 17:53

Re: Index out of bound
 
Quote:

Originally Posted by edgaras85 (Post 1329468)
Maybe you know why this error happened?


On other plugin :) Dont want to create other topic

Not enough memory for the plugin, IIRC.


All times are GMT -4. The time now is 10:20.

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