View Single Post
NikolaTesla
Junior Member
Join Date: May 2018
Location: Brazil
Old 09-07-2018 , 23:44   Re: [CS:GO] Final and fancy solution for putting a player in a team on connect
Reply With Quote #51

Quote:
Originally Posted by Ilusion9 View Post
PHP Code:

AddCommandListener
(Command_JoinGame"joingame");

public 
Action Command_JoinGame(int client, const char[] commandint args)
{
    
SetEntPropFloat(clientProp_Send"m_fForceTeam"0.0);
    
SetEntProp(clientProp_Send"m_iPendingTeamNum"CS_TEAM_CT);

Another way to assign a team on connect. Tested only on local server.
Somehow this method causes a very strange bug. When people switch back to spectator and go watch a player they will become ghosts players. In my case I run a zombie server. Let's say someone go spectate a zombie. From that point and beyond the zombie won't be able to infect humans because spectator will magically exist in front/between of that zombie no matter where they go blocking the damage and we can also hear the stabbing sounds. So weird.

Last edited by NikolaTesla; 09-07-2018 at 23:45.
NikolaTesla is offline