Raised This Month: $ Target: $400
 0% 

Gamemenu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
rainin
Member
Join Date: Apr 2011
Location: Estonia
Old 11-21-2011 , 10:46   Gamemenu
Reply With Quote #1

Hi,
so i'm trying to a gamemenu, that if you press M (chooseteam) button there will open a menu. So i would want to block all the chooseteam vgui menus and that stuff.

What i hace made so far.
PHP Code:
public public_init()
{
   
register_message(get_user_msgid("ShowMenu"), "MessageShowMenu");
   
register_message(get_user_msgid("VGUIMenu"), "MessageVGUIMenu");
   
register_clcmd"chooseteam","menu");
}
//Other
public MessageShowMenu(iMsgIDiDestiReceiver)
{
    new const 
Team_Select[] = "#Team_Select";
    
    new 
szMenu[sizeof(Team_Select)];
    
get_msg_arg_string(4szMenucharsmax(szMenu));
    
    if(!
equal(szMenuTeam_Select))
    {
         return 
PLUGIN_CONTINUE;
    }
    
    
// reset CS menu code
    
set_pdata_int(iReceiverm_iMenuCode0);
    
    
// show your own menu
    
    
return PLUGIN_HANDLED;
}

public 
MessageVGUIMenu(iMsgIDiDestiReceiver)
{
    if(
get_msg_arg_int(1) != 2)
    {
        return 
PLUGIN_CONTINUE;
    }
    
    
// show your own menu
    
    
return PLUGIN_HANDLED;
}

// Servermenu
/////////////////////////////////////////
public menu(id)
{
    new 
menu menu_create("\rGecses.eu Menu:""menu_handler");
    
    
menu_additem(menu"\wTeenused""1"0);
    
menu_additem(menu"\wReeglid""2"0);
    
menu_additem(menu"\wVipmenu""3"0);
    
menu_additem(menu"\wRaadio""4"0);
    
menu_additem(menu"\wDrShop""5"0);
    
menu_additem(menu"\wRespawn""6"0);

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}

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

    new 
data[6], iName[64];
    new 
accescallback;
    
menu_item_getinfo(menuitemaccesdata,5iName63callback);
        
    new 
key str_to_num(data);

    switch(
key)
    {
        case 
1:
        {
        
client_cmd(id"say /teenused");
        }
        case 
2:
        {
            
client_cmd(id"say /reeglid");
        }
        case 
3:
        {
            
client_cmd(id"say /vipmenu");
        }
        case 
4:
        {
            
client_cmd(id"say /raadio");
        
menu_destroy(menu);
            return 
PLUGIN_HANDLED;
        }
        case 
5:
        {
            
client_cmd(id"say /drshop");
        
menu_destroy(menu);
            return 
PLUGIN_HANDLED;
        }
          
        case 
6:
        {
            
fnRevivePlayer(id);
        
menu_destroy(menu);
            return 
PLUGIN_HANDLED;
        }
    }

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;

If someone could help, that would be awesome!

Edit: Oh and i have a problem with the menu aswell, if i press any button it doesnt open the other menu that it should.

Last edited by rainin; 11-21-2011 at 10:48.
rainin is offline
Send a message via MSN to rainin
 



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 08:34.


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