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

Plugin error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XPERA
Member
Join Date: Nov 2022
Old 04-29-2023 , 05:29   Plugin error
Reply With Quote #1

This menu plugin does not open, what could be the reason?
Attached Files
File Type: sma Get Plugin or Get Source (Toplumenu.sma - 13 views - 1.2 KB)
XPERA is offline
iNvectus
Member
Join Date: Sep 2014
Location: Bulgaria
Old 04-29-2023 , 06:20   Re: Plugin error
Reply With Quote #2

The syntax is totally wrong. Please refer to https://forums.alliedmods.net/showthread.php?t=46364 to see how the Menus work.

Here is the fixed version, but remember, it's better to start slow and get the basics correctly, then move onto advanced stuff. Don't rush things.

PHP Code:
#include <amxmodx>

public plugin_init(){
    
register_plugin("Some Menu""1.0.0""");
    
register_clcmd("say /sizofren""wa_bosmenu");
}

public 
wa_bosmenu(id) { 
    new 
menu menu_create("\wMenu basligi, SIZOFREN HUN DEATHMATCH""bosmenu")
    
    
menu_additem(menu"\ySilah menu 1 |SARI""1"0);
    
menu_additem(menu"\yImlec menu 2 |Kirmizi""2"0);
    
menu_additem(menu"\ySkin menu 3 |Saydam""3"0);
    
menu_additem(menu"\yMarket menu 4 |Beyaz""4"0);
      
menu_additem(menu"\yIsık menu 5 |Beyaz""4"0);
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}

public 
bosmenu(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata5iName63callback);

    new 
key str_to_num(data);

    switch(
key)
    {
        case 
1:
        {
            
console_cmd(id,"1. amx_silah");
        }
        case 
2:
        {
            
console_cmd(id,"2. amx_csgo");
        }
        case 
3:
        {
            
console_cmd(id,"3. amx_hunmenu");
        }
        case 
4:
        {
            
console_cmd(id,"4. amx_market");
        }
        case 
5
        {
                
console_cmd(id,"5.  amx_isik");
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;

__________________

Last edited by iNvectus; 04-29-2023 at 06:24.
iNvectus 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 18:57.


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