Raised This Month: $32 Target: $400
 8% 

Menu Index Out Of Bounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dragos
Senior Member
Join Date: Oct 2018
Location: Romania
Old 09-21-2021 , 10:48   Menu Index Out Of Bounds
Reply With Quote #1

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;

__________________
sup

Last edited by Dragos; 09-21-2021 at 10:52.
Dragos is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-21-2021 , 11:04   Re: Menu Index Out Of Bounds
Reply With Quote #2

Put the filter on top.
__________________
DJEarthQuake is offline
Dragos
Senior Member
Join Date: Oct 2018
Location: Romania
Old 09-21-2021 , 15:47   Re: Menu Index Out Of Bounds
Reply With Quote #3

Tried, also, sometimes it works, sometimes is not. Still can't parse every array...

Anddddddddd now.
"SZ_GetSpace: overflow on RS6"
__________________
sup

Last edited by Dragos; 09-21-2021 at 15:49.
Dragos is offline
Dragos
Senior Member
Join Date: Oct 2018
Location: Romania
Old 09-23-2021 , 01:45   Re: Menu Index Out Of Bounds
Reply With Quote #4

Nvm, I have just moved IT to a SQL Base, and IT work.
__________________
sup
Dragos is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:06.


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