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

[CSGO] Hooking jointeam VGUI menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
exc4libur
Member
Join Date: Oct 2015
Old 02-15-2017 , 13:22   [CSGO] Hooking jointeam VGUI menu
Reply With Quote #1

Hello,

i am having problems with forcing players to team. If i set
Code:
sv_disable_show_team_select_menu 1
and
Code:
mp_force_pick_time 0
i can force players to correct team after joining server and jointeam is also blocked automatic. The problem is, that it seems to be unpossible to force players to spectator and especially to coach! If i fake coach command, the spectator stucks on one player.

I need a method, to force player before auto-join is activated. I want to use
Code:
sv_disable_show_team_select_menu 1
mp_force_pick_time 30
so that the menu shown below isn't shown and force player then. So is it possible to hook the jointeam VGUI (where players can select there team)? Have not found anything in here.

Best regards
Christian


Last edited by exc4libur; 02-15-2017 at 13:36.
exc4libur is offline
OSWO
Senior Member
Join Date: Jul 2015
Location: United Kingdom, London
Old 02-15-2017 , 13:56   Re: [CSGO] Hooking jointeam VGUI menu
Reply With Quote #2

The command that the client is issuing is: "teammenu" for that.

You can hook that and manipulate it
__________________
SourceTimer | WeaponSkins++ | BasePlugins++ https://github.com/OSCAR-WOS
OSWO is offline
exc4libur
Member
Join Date: Oct 2015
Old 02-16-2017 , 01:43   Re: [CSGO] Hooking jointeam VGUI menu
Reply With Quote #3

Is it possible that you can give me an additional hint on how to use this? Hook or CommandListener. I have read something about that HookUserMessage is also possible to get the VGUI Menu.
exc4libur is offline
OSWO
Senior Member
Join Date: Jul 2015
Location: United Kingdom, London
Old 02-16-2017 , 02:57   Re: [CSGO] Hooking jointeam VGUI menu
Reply With Quote #4

https://sm.alliedmods.net/new-api/co...ommandListener

https://sm.alliedmods.net/new-api/console/RegConsoleCmd
__________________
SourceTimer | WeaponSkins++ | BasePlugins++ https://github.com/OSCAR-WOS
OSWO is offline
exc4libur
Member
Join Date: Oct 2015
Old 02-16-2017 , 05:41   Re: [CSGO] Hooking jointeam VGUI menu
Reply With Quote #5

Both are not working

Code:
RegConsoleCmd("teammenu", RegCommand_TeamMenu, "RegCommand_TeamMenu");
AddCommandListener(Command_TeamMenu, "teammenu");
Code:
public Action RegCommand_TeamMenu(int client, int args)
{
    LogToFile(LOG_PATH_EVENT, "TeamMenu!");
    
    return Plugin_Handled;
}

public Action:Command_TeamMenu(client, const String:command[], argc) 
{
    LogToFile(LOG_PATH_EVENT, "TeamMenu!");
    return Plugin_Continue;
}
When i use joinmenu this is working although it is fired when the player selects the team, not when menu is opened. But i need the opening hook.
exc4libur is offline
psychonic

BAFFLED
Join Date: May 2008
Old 02-16-2017 , 07:37   Re: [CSGO] Hooking jointeam VGUI menu
Reply With Quote #6

Not sure about CS:GO, but in other games, the team selection panel is triggered by the VGUIMenu usermessage. You can try hooking that and checking the panel name.
psychonic is offline
exc4libur
Member
Join Date: Oct 2015
Old 02-16-2017 , 10:44   Re: [CSGO] Hooking jointeam VGUI menu
Reply With Quote #7

The hooking of the VGUIMenu usermessage solves the problem of getting the situation in which the menu will be displayed.
But now i can not force player to a specific team.

Code:
FakeClientCommand(client, "jointeam 1"); or
CS_SwitchTeam(client, CS_TEAM_SPECTATOR); or
SetEntProp(client, Prop_Send, "m_iTeamNum", CS_TEAM_SPECTATOR);
are not working at all. How can i fake the clicking of a button at this menu?

Last edited by exc4libur; 02-16-2017 at 10:49.
exc4libur is offline
OSWO
Senior Member
Join Date: Jul 2015
Location: United Kingdom, London
Old 02-16-2017 , 11:35   Re: [CSGO] Hooking jointeam VGUI menu
Reply With Quote #8

Why "FakeClick" when you can just use

https://sm.alliedmods.net/new-api/cl...angeClientTeam

Try using the function a game frame after the hook is fired?
__________________
SourceTimer | WeaponSkins++ | BasePlugins++ https://github.com/OSCAR-WOS

Last edited by OSWO; 02-16-2017 at 11:36.
OSWO is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 02-17-2017 , 01:44   Re: [CSGO] Hooking jointeam VGUI menu
Reply With Quote #9

Quote:
Originally Posted by psychonic View Post
Not sure about CS:GO, but in other games, the team selection panel is triggered by the VGUIMenu usermessage. You can try hooking that and checking the panel name.
This might help.
__________________
Neuro Toxin is offline
exc4libur
Member
Join Date: Oct 2015
Old 02-18-2017 , 08:18   Re: [CSGO] Hooking jointeam VGUI menu
Reply With Quote #10

Hey, this is perfect. Now it is working as expected when i want to force a player to T or CT. But Spectator or Coach is still not working.
Every time i use a method to force the players to teams spectating and coaching isn't working. If i handle it normal an let the player chosse his team @ teammenu, spectation and also coaching afterwards is working as normal.

Does anyone noticed this the same way or has a solution?
exc4libur 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 18:06.


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