Raised This Month: $ Target: $400
 0% 

menu_display index 0


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-20-2018 , 13:13   Re: menu_display index 0
Reply With Quote #2

Did you really find it easier to make a thread instead of testing it yourself with 2 lines of code? You could also have taken a look at the function's code in github:

PHP Code:
//Builds the menu string for a specific page (set title to 0 to not include title)
//page indices start at 0!
static cell AMX_NATIVE_CALL menu_display(AMX *amxcell *params)
{
    
auto handle params[2];
    
GETMENU(handle);

    
int player params[1];
    
int page params[3];
    
CPlayerpPlayer GET_PLAYER_POINTER_I(player);

    if (!
CloseNewMenus(pPlayer))
    {
        
LogError(amxAMX_ERR_NATIVE"Plugin called menu_display when item=MENU_EXIT");
        return 
0;
    }

    if (!
g_NewMenus[handle])
    {
        
LogError(amxAMX_ERR_NATIVE"Invalid menu id %d (was previously destroyed)."handle);
        return 
0;
    }

    
int time = -1;
    if (
params[0] / sizeof(cell) >= 4)
        
time params[4];

    if (
time 0)
        
pPlayer->menuexpire INFINITE;
    else
        
pPlayer->menuexpire gpGlobals->time static_cast<float>(time);

    return 
pMenu->Display(playerpage);

As you can see there's no loop in the code that displays it to all players when the index is set to 0.
__________________

Last edited by OciXCrom; 04-20-2018 at 13:13.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
 



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 04:42.


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