Raised This Month: $ Target: $400
 0% 

Model Menu API


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 07-08-2021 , 17:26   Re: Model Menu API
Reply With Quote #1

Which line that make other menus won't open those are using native of rank system because when i disable this function the plugin work:

PHP Code:
public CommandSay(id)
{
    new 
szArgs[192]
    
    
read_args(szArgscharsmax(szArgs))
    
remove_quotes(szArgs)
    
trim(szArgs)

    new 
szCmd[35]
    
parse(szArgsszCmdcharsmax(szCmd))
    
trim(szCmd)
    
    if (
szCmd[0] != '/')
        return 
PLUGIN_CONTINUE
    
    
new iMenu = -1
    
    
for(new  0<= charsmax(g_iCommandSettings); i++)
    {
        if (
equali(szCmd[1], g_iCommandSettings[i][iCommands]))
        {
            
iMenu g_iCommandSettings[i][iMenuType]
            
            if (
iMenu == -1)
                return 
PLUGIN_CONTINUE
            
            g_iPlayerMenu
[id] = iMenu
            PlayerRank
(idg_iCommandSettings[i][iFlags])
            break;
        }
    }

    return 
PLUGIN_HANDLED

Or the issuse from these codes:

PHP Code:
public CustomMenu(id)
{
    new 
szData[MAX_MENU_LENGTH], szInfo[128], pFlag[64], pLevel[64], iPages
        
    formatex
(szInfocharsmax(szInfo), "%L %s"id,  "MENU_TITLE"g_szTeams[iUserTeam(id)])
    
    new 
iMenu menu_create(szInfo"Handler")
    
    for(new 
0g_iTotalModelsi++)
    {
        
ArrayGetArray(ModelsieData)
        
        
g_szAdditionalText[0] = EOS;
        
        
ExecuteForward(g_iForwards[g_MenuOpened], iReturnForwardidi)
        
        if( 
eData[Team] && eData[Team] != iUserTeam(id) )
            continue;
        
        if ( 
eData[Flag] )
            
formatex(pFlagcharsmax(pFlag), "\r[Flag: %s]"eData[Flag])
            
        if ( 
eData[Level] && min(eData[Level], iMaxLevel) )
        {
            
formatex(pLevelcharsmax(pLevel), "\r[\yLv\r:\y%d\r]"min(eData[Level], iMaxLevel))
        }
        
        
formatex(szDatacharsmax(szData), "%s%s \y%s %s %s %s",
        
access(ideData[Flag]) ? "\w" "\d"eData[Name], eData[Info], pFlagpLevelg_szAdditionalText)
            
        
menu_additem(iMenuszData)
    }
    
    
formatex(szInfocharsmax(szInfo), "%L"id"PREV_PAGE")
    
menu_setprop(iMenuMPROP_BACKNAMEszInfo)
    
formatex(szInfocharsmax(szInfo), "%L"id"NEXT_PAGE")
    
menu_setprop(iMenuMPROP_NEXTNAMEszInfo)
    
formatex(szInfocharsmax(szInfo), "%L"id"EXIT_MENU")
    
menu_setprop(iMenuMPROP_EXITNAMEszInfo)
        
    
iPages menu_pages(iMenu)
    
    if ( !
iPages )
    {
        
client_print(idprint_chat"%L"id"NOT_MODELS")
        return 
PLUGIN_HANDLED;
    }
    else if(
iPages 1)
    {
        
formatex(szInfocharsmax(szInfo), "%L %s ^n\wPage:\d"id"MENU_TITLE"g_szTeams[iUserTeam(id)])
        
menu_setprop(iMenuMPROP_TITLEszInfo)
    }
    
    
menu_display(idiMenu)
    return 
PLUGIN_HANDLED;
}

public 
Handler(idiMenuiItem
{
    if(
iItem != MENU_EXIT)
    {
        if(!
is_user_alive(id))
        {
            
client_print(idprint_chat"%L"id"NOT_ALIVE")
            return 
PLUGIN_HANDLED;
        }

        
ArrayGetArray(ModelsiItemeData)
        
        if( 
eData[Flag] && !access(ideData[Flag]) )
        {
            
client_print(idprint_chat"%L"id"NOT_ACCESS")
            return 
PLUGIN_HANDLED;
        }
        
        new 
iUserLevel get_user_level(id)
        if ( 
eData[Level] && min(eData[Level], iMaxLevel) > iUserLevel )
        {
            
client_print(idprint_chat"%L"id"NOT_LVL")
            return 
PLUGIN_HANDLED;
        }
            
        
ExecuteForward(g_iForwards[g_MenuOpened], iReturnForwardidiItem)
        
ExecuteForward(g_iForwards[g_SelectModel], iReturnForwardidiItem)
        
client_print(idprint_chat"%L"id"INFO_SELECT",
        
eData[Name], eData[Health], eData[Armor], eData[Speed],  floatround(Float:eData[Gravity] * 800.0), floatround(Float:eData[KnockBack] * 100.0), eData[MultiJump])
    }
    
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; 07-08-2021 at 17:29.
Supremache 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 09:04.


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