Raised This Month: $ Target: $400
 0% 

[SOLVED] Proper way to block team select menu popup on connect


Post New Thread Reply   
 
Thread Tools Display Modes
bibu
Veteran Member
Join Date: Sep 2010
Old 06-27-2011 , 16:12   Re: [SOLVED] Proper way to block team select menu popup on connect
Reply With Quote #11

Quote:
Originally Posted by SonicSonedit View Post
About VGUI menu - since i didn't find reliable way to hide it, I disable VGUI menu by setting _vgui_menus to 0 on player connect and then enable it right before re-showing team select menu to player (after player done with custom menu).
+ Maybe the user is playing without VGUI's?
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-27-2011 , 18:10   Re: [SOLVED] Proper way to block team select menu popup on connect
Reply With Quote #12

Quote:
Originally Posted by Hunter-Digital View Post
Just curious, am I blind but what client cvar did any of these codes change ? O.o
Nobody posted slowhacking code. We ment this:
Quote:
Originally Posted by SonicSonedit View Post
About VGUI menu - since i didn't find reliable way to hide it, I disable VGUI menu by setting _vgui_menus to 0 on player connect
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-27-2011 , 20:26   Re: [SOLVED] Proper way to block team select menu popup on connect
Reply With Quote #13

You don't have to disable VGUI menus to get this working.

Code:
#include <amxmodx> #include <fakemeta> #define m_iMenuCode 205 public plugin_init() {     register_message(get_user_msgid("ShowMenu"), "MessageShowMenu");     register_message(get_user_msgid("VGUIMenu"), "MessageVGUIMenu"); } public MessageShowMenu(iMsgID, iDest, iReceiver) {     new const Team_Select[] = "#Team_Select";         new szMenu[sizeof(Team_Select)];     get_msg_arg_string(4, szMenu, charsmax(szMenu));         if(!equal(szMenu, Team_Select))     {          return PLUGIN_CONTINUE;     }         // reset CS menu code     set_pdata_int(iReceiver, m_iMenuCode, 0);         // show your own menu         return PLUGIN_HANDLED; } public MessageVGUIMenu(iMsgID, iDest, iReceiver) {     if(get_msg_arg_int(1) != 2)     {         return PLUGIN_CONTINUE;     }         // show your own menu         return PLUGIN_HANDLED; }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 06-28-2011 , 17:18   Re: [SOLVED] Proper way to block team select menu popup on connect
Reply With Quote #14

@Exo: I tried it, but seems like the keys are still acting weird. If I open the menu manually it works perfectly:

PHP Code:
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
      
show_team_menu(iReceiver)
    
    return 
PLUGIN_HANDLED;
}

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

__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-28-2011 , 18:40   Re: [SOLVED] Proper way to block team select menu popup on connect
Reply With Quote #15

Try adding a task of 0.1 instead of calling the show menu immediately.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 06-29-2011 , 12:35   Re: [SOLVED] Proper way to block team select menu popup on connect
Reply With Quote #16

Well, it does still act weird. It does switch to my menu and forces it again back. So I can't continue.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-03-2011 , 07:00   Re: [SOLVED] Proper way to block team select menu popup on connect
Reply With Quote #17

Ok it works now, I had a typo with "jointeam" command in my code. After I force the player to join a team with the "jointeam" command, how can I block the class menu? Cause I want to show again a custom menu after joining the team.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-09-2011 , 05:31   Re: [SOLVED] Proper way to block team select menu popup on connect
Reply With Quote #18

If this is not possible, is there a way to close a VGUI menu? I tried to use some "slot" commands on the player and the "cancelselect" command. But seems like that they don't work.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 07-09-2011 , 06:16   Re: [SOLVED] Proper way to block team select menu popup on connect
Reply With Quote #19

when i tested my plugin my answers to the damn chooseteam and jointeam menu werent answered. so anyone please help.
__________________
jc980 is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-25-2011 , 15:42   Re: [SOLVED] Proper way to block team select menu popup on connect
Reply With Quote #20

Quote:
Originally Posted by bibu View Post
After I force the player to join a team with the "jointeam" command, how can I block the class menu? Cause I want to show again a custom menu after joining the team.
Bump for this.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu 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 20:13.


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