Raised This Month: $ Target: $400
 0% 

Menu on command chooseteam


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
neverminde
Senior Member
Join Date: Feb 2011
Location: St.Piter
Old 04-27-2013 , 16:20   Menu on command chooseteam
Reply With Quote #1

I've tried make server menu on command chooseteam like in ZP with possibilty to changeteam though this menu, but using return PLUGIN_CONTINUE block class choosing.
I know there are exist solutions, but i can't google it.
PHP Code:
#include <amxmodx>

new isJoin[33]

public 
plugin_init()
{
    
register_plugin"PLUGIN""VERSION""AUTHOR" )
    
register_clcmd "realjoin""cmdReal" )
    
register_clcmd "jointeam""cmdJoin" )
    
register_clcmd "server_menu""cmdMenu")
}

public 
client_putinserver(id)
{
    
isJoin[id]=0
}

public 
cmdReal(id)
{
    
isJoin[id]=1
}

public 
cmdJoin(id)
{
    if ( 
isJoin[id]==)
    {
        
client_cmdid"server_menu" )
        return 
PLUGIN_HANDLED
    
}
    
    
isJoin[id]=0
    
return PLUGIN_CONTINUE
}

public 
cmdMenu(id)
{    
    new 
Menu menu_create("\ynew test menu""menu_handler")
        
    
menu_additem(Menu"Change Team""1"0)
    
    
menu_display(idMenu0)
    
    return 
PLUGIN_HANDLED
}

public 
menu_handler(id,menu,item)
{
    if(
item == MENU_EXIT)
    {
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], iName[64], accesscallback
    menu_item_getinfo
(menuitemaccessdata5iName63callback)
    
    new 
key str_to_num(data)
    switch(
key)
    {
        case 
1
        {
            
client_cmdid"realjoin; jointeam" )
        }
    }

    new 
oldmenunewmenumenupage
    player_menu_info
(idoldmenunewmenumenupage)
    return 
PLUGIN_CONTINUE

neverminde is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 04-27-2013 , 18:07   Re: Menu on command chooseteam
Reply With Quote #2

Quote:
Originally Posted by neverminde View Post
I've tried make server menu on command chooseteam like in ZP with possibilty to changeteam though this menu, but using return PLUGIN_CONTINUE block class choosing.
I know there are exist solutions, but i can't google it.
PHP Code:
#include <amxmodx>

new isJoin[33]

public 
plugin_init()
{
    
register_plugin"PLUGIN""VERSION""AUTHOR" )
    
register_clcmd "realjoin""cmdReal" )
    
register_clcmd "jointeam""cmdJoin" )
    
register_clcmd "server_menu""cmdMenu")
}

public 
client_putinserver(id)
{
    
isJoin[id]=0
}

public 
cmdReal(id)
{
    
isJoin[id]=1
}

public 
cmdJoin(id)
{
    if ( 
isJoin[id]==)
    {
        
client_cmdid"server_menu" )
        return 
PLUGIN_HANDLED
    
}
    
    
isJoin[id]=0
    
return PLUGIN_CONTINUE
}

public 
cmdMenu(id)
{    
    new 
Menu menu_create("\ynew test menu""menu_handler")
        
    
menu_additem(Menu"Change Team""1"0)
    
    
menu_display(idMenu0)
    
    return 
PLUGIN_HANDLED
}

public 
menu_handler(id,menu,item)
{
    if(
item == MENU_EXIT)
    {
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], iName[64], accesscallback
    menu_item_getinfo
(menuitemaccessdata5iName63callback)
    
    new 
key str_to_num(data)
    switch(
key)
    {
        case 
1
        {
            
client_cmdid"realjoin; jointeam" )
        }
    }

    new 
oldmenunewmenumenupage
    player_menu_info
(idoldmenunewmenumenupage)
    return 
PLUGIN_CONTINUE

are you trying to force players to use your team choose menu instead?

Code:
register_clcmd("chooseteam", "cmdChooseTeam", 0); public cmdChooseTeam(id) { // put your menu in here and add all options for each team to choose. }

EDIT: added custom team choose menu i just made... so if this is what you want.
Attached Files
File Type: sma Get Plugin or Get Source (custom-chooseteam.sma - 727 views - 2.4 KB)
__________________

Last edited by Blizzard_87; 04-27-2013 at 19:27.
Blizzard_87 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 10:48.


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