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

[CS:GO] Final and fancy solution for putting a player in a team on connect


Post New Thread Reply   
 
Thread Tools Display Modes
joao7yt
Senior Member
Join Date: Nov 2014
Location: Brazil
Old 09-06-2017 , 04:37   Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Reply With Quote #11

Quote:
Originally Posted by Neuro Toxin View Post
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.
Well, then you need the player to select a team, which is not "fancy". My way it's exactly like valve does on their servers. And also if a player joins spec, you don't have player spawn to hook. And also if you do want to have the team menu disabled in your server, you wouldn't be able, since you require the client to spawn or do jointeam.
joao7yt is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 09-06-2017 , 17:04   Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Reply With Quote #12

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.
__________________
Neuro Toxin is offline
joao7yt
Senior Member
Join Date: Nov 2014
Location: Brazil
Old 09-06-2017 , 17:12   Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Reply With Quote #13

Quote:
Originally Posted by Neuro Toxin View Post
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.
Then 2 of the 3 problems I mentioned with your method remains: it requires the player to actually select a team, clicking it in the menu (which I think unnecessary since my method bypasses it), and if you want to disable the team menu with "sv_disable_show_team_select_menu 1", you won't be able.
joao7yt is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 09-06-2017 , 17:47   Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Reply With Quote #14

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.
__________________
Neuro Toxin is offline
joao7yt
Senior Member
Join Date: Nov 2014
Location: Brazil
Old 09-06-2017 , 17:56   Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Reply With Quote #15

Quote:
Originally Posted by Neuro Toxin View Post
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.
Oh, wait, the spawn you are saying is when the player connects? If so, I was doing it before, but as I said, if you change the client's with the "Continue" screen opened, it will bug the client, he won't be able to use the team menu to change team... I mean, if you already don't want the client to change team, it's ok, but in my case I want to let them to go to spec (then I set them as a coach for the team he was), and let coaches join to play on the team he's coaching... anyway, what I mean is that changing the client's team too soon (more specifically with the "Continue" screen opned) it will bug the team menu for that client.

Last edited by joao7yt; 09-06-2017 at 17:57.
joao7yt is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 09-06-2017 , 18:06   Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Reply With Quote #16

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.
__________________
Neuro Toxin is offline
joao7yt
Senior Member
Join Date: Nov 2014
Location: Brazil
Old 09-06-2017 , 18:14   Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Reply With Quote #17

Quote:
Originally Posted by Neuro Toxin View Post
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.
I don't see why set team vgui to false... what i'm saying is that the team menu gets unusable if you set the client's team with this screen opened, and I think your method will do exactly that, won't it? Because I think the player spawn callback is called right after the client finishes loading the map, where this screen appears... don't it?

If so, just try to change team after being spawned. You won't be able to use the menu.
joao7yt is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 09-06-2017 , 18:26   Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Reply With Quote #18

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.
__________________

Last edited by Neuro Toxin; 09-06-2017 at 18:28.
Neuro Toxin is offline
joao7yt
Senior Member
Join Date: Nov 2014
Location: Brazil
Old 09-06-2017 , 18:30   Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Reply With Quote #19

Quote:
Originally Posted by Neuro Toxin View Post
The order will be.

OnSpawn > Request Frame
VGUI > hide
Set Team after VGUI is hidden
Ok
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
joao7yt is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 09-06-2017 , 18:33   Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Reply With Quote #20

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.
__________________
Neuro Toxin is offline
Reply


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 17:32.


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