[CS:GO] Final and fancy solution for putting a player in a team on connect
As the Panorama doesn't have a Continue Screen, it's now possible to use the "player_connect_full" HookEvent:
PHP Code:
Spoiler
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Finally! Thank you very much <3
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
This plugins has one bug, it returns Plugin_Handled on every VGUI, you should return Plugin_Handled only if this is VGUI for teams, but overall idea is the best! <3
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Note: for some reason "return Plugin_Handled;" is necessary after doing a "ChangeClientTeam", otherwise the server crashes. I'm saying it because I tried doing "PbSetBool(msg, "show", false);" (which will make the team menu to not show) and then "return Plugin_Continue;", because idk if simply doing "return Plugin_Handled;" would lead to a future bug, but seems it's not possible to call "return Plugin_Continue;" after changing the client's team without crashing the server.
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Your PbSetBool would have been throwing an error (because usermessages can't be modified from a usermessage hook) and aborting the call, which would cause later usermessage creation to become unbalanced, which caused the "crash" (it wasn't a crash in the normal sense, the server threw a fatal error).
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Guys, I might have found a bug related to it: if you change the client's team inside that hook, it could rarely throw a fatal error and crash the srcds.exe. I did a few tests and it might have gone if you create a timer to change the client's team, which is not a problem since we will still be able to hook when the team menu shows, it will only put the client in a team a bit later. I put 0.1 seconds in my timer and got no crashes. So be warned, guys.
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
I hook on player spawn.
The first occurrence is from client connecting. The second occurrence u can change the team and cs_respawn the client. A better way is to listen to the jointeam command. Wait a frame and then set your team. |
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Spawn calls for spec.
If you dont want a team menu. Wait a frame from the first spawn call during join and set your team and cs respawn if you want to. |
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Just set show to false in the VGUIMenu hook if sv_disable_show_team_select_menu doesn't work for you.
The team menu is distributed on the first spawn call. So wait a frame and then set your team. |
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
On connect set a flag to set show to false in the vgui to block the team menu.
On first spawn use request frame and set the team in the callback. On first team vgui set show to false and clear your flag. |
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
If so, just try to change team after being spawned. You won't be able to use the menu. |
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
The order will be.
OnSpawn > Request Frame VGUI > hide Set Team after VGUI is hidden You are right. If u play with teams during the vgui you're screwed after an update a while back. I wrote a whole thread on this then made the motd changer plugin. |
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
Which spawn is that? the client full connected? or the client being spawned in a team? Which vgui? The vgui which shows the "Continue" screen? because I think there's no vgui for that screen. Because I said, using ChangeClientTeam with that screen being showed, will bug the team menu... Why don't you simply post the code here lol |
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
The spawn is the very first one from connect.
It's been a while since the update that fucked with this stuff. Im pretty sure if you block the team menu the continue screen doesn't show. |
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
You could "bypass" the bugs by adding a timer to put the client in a team when the "Continue" screen (this one) was gone, but if the player minimize the game, the "Continue" screen is paused, making the timer useless, since it would trigger "ChangeClientTeam" with the "Continue" screen being showed. |
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
This post ended up helping me do something.
This is kinda crappy but...I hook the VGUIMenu, if its the first appearance, I move the client to spectator to get rid of the menu, then I show a new team menu one 0.1 seconds later. The difference is the new menu doesn't have the countdown of mp_force_pick_time seconds. Also I want people to see the menu just without a countdown. Some questions:
PHP Code:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
PHP Code:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
For CS:GO:
mp_force_pick_time 0 mp_force_assign_teams 0 HookEvent: player_connect_full, then requestframe changeclientteam. This works without any bugs (like buying weapons). This is for people which don't want to use vguimenu. |
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
GetClientAuthId works in player_connect_full. then you check the steamid and use ChangeClientTeam. |
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
Quote:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
It is working for CS:S?
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Why dont you use RequestFrame instead of 0.1 timers (:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Yeah it works
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
If someone is interested using this way you can put a player on a team on connect(without showing the teammenu) and prevent its change.
PHP Code:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
Code:
Plugin_Stop |
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
|
Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Quote:
|
| All times are GMT -4. The time now is 23:34. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.