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[] name, bool 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(client, 2); // move client to Terrorists
}
}
__________________