AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Menu Index Out Of Bounds (https://forums.alliedmods.net/showthread.php?t=334405)

Dragos 09-21-2021 10:48

Menu Index Out Of Bounds
 
Hello,

I wanted to add news stuff to my plugin, the idea was good, but I encounter a problem. When the first player from the list (players.dat) left, or join other clans, that error appears. Tried changing the map, reload functions, tried modifying, but it gives the same shit. Also, the problem is only from the menu, printing if their online or not and their id is working fine

https://imgur.com/a/NfKyE0S
[It appear only one time, I only double-checked it]

GetData1 is the name of the currently joined clan
g_Words2 is the Clan Name that the player is in (searching from the list 0,1,2,3....)
g_Words1 is The User Name
I'm using that variable count to determine in every array the data that has been loaded.

Also, before using searching for "iPlrId" it still threw me that error.

PHP Code:

public members_menu(id) {
    new 
menu menu_create("""MenuHandlerMembers");
    new 
count 
    
new found 0
    
while(found != TotalMembersPerClan[id])
    {
        if(
equali(g_Words2[count], GetData1)) {
            new 
ContextOn[192]
            
formatex(ContextOn191"%s \d[\yOnline\d]"g_Words1[count])
            new 
ContextOff[192]
            
formatex(ContextOff191"%s \d[\rOffline\d]"g_Words1[count])
            
            new 
iPlrId find_player("a"g_Words1[count][0]);
            
            if(
is_user_connected(iPlrId)) {
                
menu_additem(menuContextOn"0")
                
culoare(id"!gYES %d"iPlrId)
            }
            else
            {
                
menu_additem(menuContextOff"0")
                
culoare(id"!gNO %d"iPlrId)
            }
            
found++

        }
        
count++
    }

    
menu_setprop(menuMPROP_EXITMEXIT_ALL
    
menu_display(idmenu);
    return 
PLUGIN_HANDLED;



DJEarthQuake 09-21-2021 11:04

Re: Menu Index Out Of Bounds
 
Put the filter on top.

Dragos 09-21-2021 15:47

Re: Menu Index Out Of Bounds
 
Tried, also, sometimes it works, sometimes is not. Still can't parse every array...

Anddddddddd now.
"SZ_GetSpace: overflow on RS6"

Dragos 09-23-2021 01:45

Re: Menu Index Out Of Bounds
 
Nvm, I have just moved IT to a SQL Base, and IT work.


All times are GMT -4. The time now is 11:42.

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