Raised This Month: $ Target: $400
 0% 

Adding Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 12-20-2014 , 09:04   Re: Adding Menu
Reply With Quote #1

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

Last edited by tousif; 12-20-2014 at 09:06.
tousif 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 15:25.


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