AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Adding Menu (https://forums.alliedmods.net/showthread.php?t=253319)

tousif 12-20-2014 01:37

Adding Menu
 
I want to Add A menu in amxmodmenu . I have done some changes in plugin and want to add that plugin to amxmodmenu . When i Click that menu A submenu with players present in server must be come and when press the player name that command shoud be executed on player

the plugin is Pika If u want the script let me knw ill upload it

I want to add it in plugin not in customemnu.cfg

YamiKaitou 12-20-2014 07:46

Re: Adding Menu
 
http://amxmodx.org/api/amxmisc/AddMenuItem

tousif 12-20-2014 08:10

Re: Adding Menu
 
MENU_PLUGIN: The exact case-insensitive name of plugin holding the menu command

Cant Understand this ^^ plzz help

YamiKaitou 12-20-2014 08:18

Re: Adding Menu
 
It is the name of the plugin.... Examples

tousif 12-20-2014 09:04

Re: Adding Menu
 
PHP Code:

#include < amxmodx >
#include < cstrike >
#include < amxmisc >

public plugin_init ( )
{
register_plugin PLUGINVERSIONAUTHOR )

// Add your code here...
register_clcmd "amx_pika""cmdPika"ADMIN_LEVEL_D"<name or #userid>" );
register_clcmd("amx_pikamenu""ShowMenu"ADMIN_LEVEL_D"Opens Pika Menu");
server_cmd("amx_addmenuitem ^"Pika Menu^" ^"amx_pikamenu^" ^"hu^" ^"amx_pikav5.amxx^"");
}


public 
ShowMenu(id)
{
    new 
menu menu_create("Pika Menu""mh_PikaMenu");
    new 
players[32], pnumtempid;
    new 
szName[32], szUserId[32];
    
get_playersplayerspnum"f" );
   
    for ( new 
ii<pnumi++ )
    {
        
tempid players[i];
        
get_user_nametempidszNamecharsmaxszName ) );
        
formatexszUserIdcharsmaxszUserId ), "%d"get_user_useridtempid ) );
        
menu_additemmenuszNameszUserId);
    }
    
menu_displayidmenu);
}


public 
mh_PikaMenu(idmenuitem)
{
new 
command[6], name[64], accesscallback;

menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);

menu_destroy(menu);

return 
PLUGIN_HANDLED;


This is the plugin code I have removed some code I have added menu and in sub menu players list come I want when i press on player name the command must be executed ex:ban I ll change add that later just say how to do and * mark comes if player is admin

THANKS IN ADVANCE HOPE ILl Get will HELp

YamiKaitou 12-20-2014 09:15

Re: Adding Menu
 
Code:

server_cmd("amx_addmenuitem ^"Pika Menu^" ^"amx_pikamenu^" ^"hu^" ^"amx_pikav5.amxx^"");
:arrow:
Code:

AddMenuItem("Pika Menu", "amx_pikamenu", ADMIN_LEVEL_D, PLUGIN);

tousif 12-20-2014 09:20

Re: Adding Menu
 
i must replace it ?

YamiKaitou 12-20-2014 09:27

Re: Adding Menu
 
Yes

tousif 12-21-2014 03:13

Re: Adding Menu
 
That Pika Menu Is comming In amxmodmenu and I can see players also but when i press player that command is not executed on player plzz

Give me the code or Add in this code Thanks In advanced
PHP Code:


#include < amxmodx >
#include < cstrike >
#include < amxmisc >

public plugin_init ( )
{
register_plugin PLUGINVERSIONAUTHOR )

// Add your code here...
register_clcmd "amx_pika""cmdPika"ADMIN_LEVEL_D"<name or #userid>" );
register_clcmd("amx_pikamenu""ShowMenu"ADMIN_LEVEL_D"Opens Pika Menu");
server_cmd("amx_addmenuitem ^"Pika Menu^" ^"amx_pikamenu^" ^"hu^" ^"amx_pikav5.amxx^"");
}


public 
ShowMenu(id)
{
    new 
menu menu_create("Pika Menu""mh_PikaMenu");
    new 
players[32], pnumtempid;
    new 
szName[32], szUserId[32];
    
get_playersplayerspnum"f" );
   
    for ( new 
ii<pnumi++ )
    {
        
tempid players[i];
        
get_user_nametempidszNamecharsmaxszName ) );
        
formatexszUserIdcharsmaxszUserId ), "%d"get_user_useridtempid ) );
        
menu_additemmenuszNameszUserId);
    }
    
menu_displayidmenu);
}


public 
mh_PikaMenu(idmenuitem)
{
new 
command[6], name[64], accesscallback;

menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);

menu_destroy(menu);

return 
PLUGIN_HANDLED;


</span></span>

YamiKaitou 12-21-2014 06:44

Re: Adding Menu
 
That is because your menu doesn't do anything


All times are GMT -4. The time now is 09:40.

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