Raised This Month: $ Target: $400
 0% 

Hooking team_select - the old menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
portocala
Member
Join Date: Jun 2010
Old 08-24-2012 , 16:45   Hooking team_select - the old menu
Reply With Quote #1

Hello,

My server mod is GunGame (respawn).

I use this to hook all possible team menus (I know that only 2-3 of them are usable in case of not using VIP, but just to be sure):

Code:
register_menucmd(register_menuid("#IG_Team_Select_Spect", true), MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6, "select_team_old");
register_menucmd(register_menuid("#Team_Select_Spect", true), MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6|MENU_KEY_0, "select_team_old");
register_menucmd(register_menuid("#IG_Team_Select", true), MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_0, "select_team_old");
register_menucmd(register_menuid("#IG_VIP_Team_Select", true), MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_5|MENU_KEY_6|MENU_KEY_0, "select_team_old");
register_menucmd(register_menuid("#IG_VIP_Team_Select_Spect", true), MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_0, "select_team_old");
I use this in order to implement some team checks before joining a team. If the chosen option (team) doesn't match my requirements, the command is blocked (return PLUGIN_HANDLED), an informative message appears, and the menu shows up again (engclient_cmd(id, "chooseteam"))

The problem is that in some cases (let's say 1 / 10), the menu appears, the key is pressed (1, 2, 5, 6 - doesn't matter) but the function isn't called.

Under what circumstances the function ("select_team_old") is not hooked to the menu ?

Thank you!

LE: I remember that I've done some tests some time ago and the problem doesn't exist if the server is empty (me being the only player).

Last edited by portocala; 08-24-2012 at 16:57.
portocala is offline
 


Thread Tools
Display Modes

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 05:43.


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