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

Hook Team Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ish12321
Veteran Member
Join Date: May 2016
Old 05-24-2018 , 10:31   Hook Team Menu
Reply With Quote #1

Code:
RegisterHookChain(RG_HandleMenu_ChooseTeam, "RG_Hook_ChooseTeam", false);
Hello,
I am using this above hook to block team change/force some specific team on some specific conditions.
Recently viewed smiley's pugmod. It uses some another method :
Code:
register_menucmd(-2,MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6,"fnTeamSelect"); register_menucmd(register_menuid("Team_Select",1),MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6,"fnTeamSelect");

Are the two equivalent ? If so, could someone explain me what the -2 in the first line stands for ?
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here

Last edited by ish12321; 05-24-2018 at 10:31.
ish12321 is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 05-24-2018 , 10:39   Re: Hook Team Menu
Reply With Quote #2

hehe

RegisterHookChain is a new function in reapi on these days?

I do not updated pugMod for newest amxx, but if i understand my functions still hooking only needed keys instead of filter this in RG_Hook_ChooseTeam function. I guess old way is better duo will not use a filter in fulction itself, but only in register part.


Edit:
-2 is the menu id used by VGUI menu (New menu) if i remember.
register_menuid("Team_Select",1) i need to use to hook old menu id that can change if i am not wrong.

Ps. i do not know why, but i preffer to use amxx way is better on my opinion duo compatibility
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 05-24-2018 at 10:46.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
ish12321
Veteran Member
Join Date: May 2016
Old 05-24-2018 , 11:32   Re: Hook Team Menu
Reply With Quote #3

Could you explain more about new menu and old menu with respect to team change menu.
Also, is -2 general VGUI menu id or VGUI menu id specific to team change menu. Also, can new menu id not change. Is there some way to use newmenu id with register_menuid like we did with old menu. Also, is there any source from which I can get all codes such as "Team_Select" ?
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here
ish12321 is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 05-24-2018 , 12:02   Re: Hook Team Menu
Reply With Quote #4

Quote:
Originally Posted by ish12321 View Post
Could you explain more about new menu and old menu with respect to team change menu.
Also, is -2 general VGUI menu id or VGUI menu id specific to team change menu. Also, can new menu id not change. Is there some way to use newmenu id with register_menuid like we did with old menu. Also, is there any source from which I can get all codes such as "Team_Select" ?
Is specific to team change bro, you still need to get menu id on old style menus.
Also what you need to do in first place with these menus?

Since new menus are static on client side, no way to create a new VGUI menu without editing client (that is illegal i guess).

The best way is work with native amx menu or old style menu creating, i do not see any problem with.
But again, i need to know what you trying to do here.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
ish12321
Veteran Member
Join Date: May 2016
Old 05-24-2018 , 14:03   Re: Hook Team Menu
Reply With Quote #5

Okay
One more thing
What is difference between chooseteam and jointeam client commands. I've seen many people use those seperately with different actions. Also, is it good to use those or hook vguimenu msg and block that if that msg was of a team choose menu.
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here
ish12321 is offline
ish12321
Veteran Member
Join Date: May 2016
Old 05-24-2018 , 14:30   Re: Hook Team Menu
Reply With Quote #6

Also, is it possible to alter the key selected by the player ?
I want to force player some team. I'm using this because as per what I know if we use cs_set_user_team when player has CS_TEAM_UNASSIGNED, it gives errors. So, I want that when player tries to change team, I change his team as per my will.
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here
ish12321 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 05:44.


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