Raised This Month: $ Target: $400
 0% 

Solved Combine the menus


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 05-22-2021 , 14:40   Combine the menus
Reply With Quote #1

Hi There,
I tried to combining the menus together, but my code doesn't work what is the wrong ?

Code:
enum _:eMenuType {         CHECK_RANK,     RESET_RANK,     MANAGE_RANK }; public PlayerRank(id, iLevel, iCid) {     if(!cmd_access(id, iLevel, iCid, 1))     {         return PLUGIN_HANDLED     }     new iPlayers[MAX_PLAYERS], iPnum, szUserID[32], szTitle[128], iMenu         switch ( iMenu )     {         case CHECK_RANK:         {             MenuTitle("\yRank System: \rXP List")         }         case RESET_RANK:         {             MenuTitle("\yRank System: \rReset Data")         }         case MANAGE_RANK:         {             MenuTitle("\yRank System: \rManage Players")         }     }         iMenu = menu_create(szTitle, "Handler")     get_players(iPlayers, iPnum, "ch"); SortCustom1D(iPlayers, iPnum, "sort_players_by_xp")         for(new szItem[1024], iPlayer, i; i < iPnum; i++)     {         iPlayer = iPlayers[i]                 MenuInfo("\d[%i XP] \w%s \r[\yLevel %i: %s\r]")         formatex( szUserID, charsmax( szUserID ), "%d", get_user_userid(iPlayer))         menu_additem(iMenu, szItem, szUserID)     }         menu_setprop(iMenu, MPROP_BACKNAME, "Previous page")     menu_setprop(iMenu, MPROP_NEXTNAME, "Next page")     menu_setprop(iMenu, MPROP_EXITNAME, "\rClose")     menu_display(id, iMenu)     return PLUGIN_HANDLED } public Handler(id, iMenu, iItem) {     new iAccess, iCallback, iData[6],iName[64];         menu_item_getinfo(iMenu, iItem, iAccess, iData, charsmax(iData), iName, charsmax(iName), iCallback);         new iPlayer = str_to_num(iData);         switch ( iMenu )     {         case CHECK_RANK:         {             return PLUGIN_HANDLED         }         case RESET_RANK:         {             if(get_user_flags(id) & eResetDataFlag)             {                 ResetPlayerRank(id, iPlayer);                 Print(id, "[Rs] You don't have access.");             }         }         case MANAGE_RANK:         {             if(get_user_flags(id) & eManagePlayer)             {                 ChoosePlayerRank(id, iPlayer);                 Print(id, "[Rs] You don't have access.");             }         }     }     menu_destroy(iMenu)     return PLUGIN_HANDLED }
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 05-23-2021 at 13:40.
Supremache is offline
 


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 02:37.


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