Raised This Month: $12 Target: $400
 3% 

menu_display index 0


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ish12321
Veteran Member
Join Date: May 2016
Old 04-20-2018 , 12:51   menu_display index 0
Reply With Quote #1

Hey,
Does menu_display accepts index 0 to show the menu to all players in amxmodx 1.8.3 latest dev build ? I know it is not so in 1.8.2
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here
ish12321 is offline
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
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-20-2018 , 13:37   Re: menu_display index 0
Reply With Quote #3

Whats the different in pPlayer and player
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-20-2018 , 23:05   Re: menu_display index 0
Reply With Quote #4

One is an integer and the other is a pointer to an instance of the CPlayer class (which is where you would store player data internally; hence why you see that's the only one used to get or store data that is specific to that player).
__________________

Last edited by fysiks; 04-20-2018 at 23:09.
fysiks is offline
Reply


Thread Tools
Display Modes

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 07:30.


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