[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. |
All times are GMT -4. The time now is 12:35. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.