Raised This Month: $51 Target: $400
 12% 

Adding Menu


Post New Thread Reply   
 
Thread Tools Display Modes
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 12-22-2014 , 07:21   Re: Adding Menu
Reply With Quote #11

thats what i need I want my menu to execute command on player but i dont knw hw to do so Can any one add it when i click on player the command must execute on him plzz help just post the code

Last edited by tousif; 12-22-2014 at 07:28.
tousif is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 12-22-2014 , 08:06   Re: Adding Menu
Reply With Quote #12

Quote:
Originally Posted by tousif View Post
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>
Quote:
Originally Posted by YamiKaitou View Post
Code:
server_cmd("amx_addmenuitem ^"Pika Menu^" ^"amx_pikamenu^" ^"hu^" ^"amx_pikav5.amxx^"");

Code:
AddMenuItem("Pika Menu", "amx_pikamenu", ADMIN_LEVEL_D, PLUGIN);
__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
Old 12-22-2014, 08:13
tousif
This message has been deleted by tousif.
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 12-22-2014 , 08:14   Re: Adding Menu
Reply With Quote #13

Indra plzz Help
tousif is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 12-22-2014 , 08:17   Re: Adding Menu
Reply With Quote #14

Quote:
Originally Posted by tousif View Post
Indra plzz Help
i already did now whats your problem ?
any error
Edit: Put pika function in the menu
__________________
Thanks everyone. #miss_you_all

Last edited by indraraj striker; 12-22-2014 at 08:22.
indraraj striker is offline
Old 12-22-2014, 08:37
tousif
This message has been deleted by tousif.
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-23-2014 , 11:48   Re: Adding Menu
Reply With Quote #15

You need to code the rest of your menu because right now, it does nothing
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Old 12-24-2014, 06:01
tousif
This message has been deleted by YamiKaitou. Reason: slowhacking
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-24-2014 , 07:38   Re: Adding Menu
Reply With Quote #16

Add this
Code:
AddMenuItem("Pika Menu", "amx_pikamenu", ADMIN_LEVEL_D, PLUGIN);
to plugin_init


And then write the cmdPikaMenu function yourself
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 12-24-2014 , 07:53   Re: Adding Menu
Reply With Quote #17

I want to Place Pika Menu After The Map Voting
tousif is offline
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 12-24-2014 , 08:25   Re: Adding Menu
Reply With Quote #18

PHP Code:

 
public cmdPikaMenuid )
 {
    new 
menu menu_create"\rPika Menu""menu_handler" );
    new 
players[32], pnumtempid;
    new 
szName[32], szUserId[32];
    
get_playersplayerspnum"c" ); 

    for ( new 
ii<pnumi++ )
    {
        
tempid players[i];
        
get_user_nametempidszNamecharsmaxszName ) );
        
formatexszUserIdcharsmaxszUserId ), "%d"get_user_useridtempid ) );
        
menu_additemmenuszNameszUserId);
    }
    
menu_displayidmenu);
 }

 public 
menu_handleridmenuitem )
 {
    if ( 
item == MENU_EXIT )
    {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }

    new 
szData[6], szName[64];
    new 
item_accessitem_callback;
    
menu_item_getinfomenuitem_accessszData,charsmaxszData ), szName,charsmaxszName ), item_callback );
    new 
userid str_to_numszData );
    new 
player find_player"k"userid ); // flag "k" : find player from userid

    
if ( player && is_user_connectedplayer ) )
    {
        
server_cmd "amx_pika %s"player)
    }

    
menu_destroymenu );
    return 
PLUGIN_HANDLED;
 } 
Is This ok
tousif is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-24-2014 , 11:17   Re: Adding Menu
Reply With Quote #19

Quote:
Originally Posted by tousif View Post
I want to Place Pika Menu After The Map Voting
Then you will need to add that line in menusfront.sma, such as below

Code:
AddDefaultMenus() {     new flags;     AddMenuLang("KICK_PLAYER", "amx_kickmenu", get_clcmd_flags("amx_kickmenu", flags) ? flags : ADMIN_KICK , "Players Menu")     AddMenuLang("BAN_PLAYER", "amx_banmenu", get_clcmd_flags("amx_banmenu", flags) ? flags : ADMIN_BAN, "Players Menu")     AddMenuLang("SLAP_SLAY", "amx_slapmenu", get_clcmd_flags("amx_slapmenu", flags) ? flags : ADMIN_SLAY, "Players Menu")     AddMenuLang("TEAM_PLAYER", "amx_teammenu", get_clcmd_flags("amx_teammenu", flags) ? flags : ADMIN_LEVEL_A, "Players Menu")     AddMenuLang("CHANGEL", "amx_mapmenu", get_clcmd_flags("amx_mapmenu", flags) ? flags : ADMIN_MAP, "Maps Menu")     AddMenuLang("VOTE_MAPS", "amx_votemapmenu", get_clcmd_flags("amx_votemapmenu", flags) ? flags : ADMIN_VOTE, "Maps Menu")
    AddMenuItem("Pika Menu", "amx_pikamenu", ADMIN_LEVEL_D, "AMXX Pika V5");
    AddMenuLang("SPECH_STUFF", "amx_speechmenu", get_clcmd_flags("amx_speechmenu", flags) ? flags : ADMIN_MENU, "Commands Menu")     AddMenuLang("CLIENT_COM", "amx_clcmdmenu", get_clcmd_flags("amx_clcmdmenu", flags) ? flags : ADMIN_LEVEL_A, "Players Menu")     AddMenuLang("SERVER_COM", "amx_cmdmenu", get_clcmd_flags("amx_cmdmenu", flags) ? flags : ADMIN_MENU, "Commands Menu")     AddMenuLang("CVARS_SET", "amx_cvarmenu", get_clcmd_flags("amx_cvarmenu", flags) ? flags : ADMIN_CVAR, "Commands Menu")     AddMenuLang("CONFIG", "amx_cfgmenu", get_clcmd_flags("amx_cfgmenu", flags) ? flags : ADMIN_MENU, "Commands Menu")     AddMenuLang("LANG_SET", "amx_langmenu", get_clcmd_flags("amx_langmenu", flags) ? flags : ADMIN_CFG, "Multi-Lingual System")     AddMenuLang("STATS_SET", "amx_statscfgmenu", get_clcmd_flags("amx_statscfgmenu", flags) ? flags : ADMIN_CFG, "Stats Configuration")     AddMenuLang("PAUSE_PLUG", "amx_pausecfgmenu", get_clcmd_flags("amx_pausecfgmenu", flags) ? flags : ADMIN_CFG, "Pause Plugins")     AddMenuLang("RES_WEAP", "amx_restmenu", get_clcmd_flags("amx_restmenu", flags) ? flags : ADMIN_CFG, "Restrict Weapons")     AddMenuLang("TELE_PLAYER", "amx_teleportmenu", get_clcmd_flags("amx_teleportmenu", flags) ? flags : ADMIN_CFG, "Teleport Menu") }
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 12-24-2014 , 11:26   Re: Adding Menu
Reply With Quote #20

Quote:
Originally Posted by tousif View Post
PHP Code:

 
public cmdPikaMenuid )
 {
    new 
menu menu_create"\rPika Menu""menu_handler" );
    new 
players[32], pnumtempid;
    new 
szName[32], szUserId[32];
    
get_playersplayerspnum"c" ); 

    for ( new 
ii<pnumi++ )
    {
        
tempid players[i];
        
get_user_nametempidszNamecharsmaxszName ) );
        
formatexszUserIdcharsmaxszUserId ), "%d"get_user_useridtempid ) );
        
menu_additemmenuszNameszUserId);
    }
    
menu_displayidmenu);
 }

 public 
menu_handleridmenuitem )
 {
    if ( 
item == MENU_EXIT )
    {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }

    new 
szData[6], szName[64];
    new 
item_accessitem_callback;
    
menu_item_getinfomenuitem_accessszData,charsmaxszData ), szName,charsmaxszName ), item_callback );
    new 
userid str_to_numszData );
    new 
player find_player"k"userid ); // flag "k" : find player from userid

    
if ( player && is_user_connectedplayer ) )
    {
        
server_cmd "amx_pika %s"player)
    }

    
menu_destroymenu );
    return 
PLUGIN_HANDLED;
 } 
Is This ok
yami Is this correct if any erros fix it plzz

Thanks iN ADVAANce
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 04:01.


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