AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved [CSGO] Bypass choose team screen? (https://forums.alliedmods.net/showthread.php?t=334326)

Austin 09-16-2021 02:53

[CSGO] Bypass choose team screen?
 
Can someone show how to automaticially choose a team for a human joining and totally bypass the choose team screen you see when you first connect?
tx

FAQU 09-16-2021 04:33

Re: [CSGO] Bypass choose team screen?
 
PHP Code:

#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

public void OnPluginStart()
{
    
HookEvent("player_connect_full"Event_PlayerConnectFull); // event fired when the player is fully connected and in-game
}

public 
void Event_PlayerConnectFull(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid")); // get client from event key "userid"
    
if (client && !GetClientTeam(client)) // check if the client is valid and not assigned to a team yet
    
{
        
ChangeClientTeam(client2); // move client to Terrorists
    
}



Austin 09-16-2021 10:50

Re: [CSGO] Bypass choose team screen?
 
The plugin that I am working on is

If a human is joining and is the first human joining let them pick the team
else
automaticially put them on the human team

The reason I am not using
mp_humanteam
is I want to allow switching teams once they are on.

If a human switches after joining all humans switch with them.

It works!
This is the part I didn't have.
Exactly what I needed
Thanks!


All times are GMT -4. The time now is 22:36.

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