Here an example to hook that:
PHP Code:
#include <sourcemod>
#include <cstrike>
public OnPluginStart( )
{
AddCommandListener(SelectTeam, "jointeam");
}
public Action SelectTeam(int client, const char[] command, int args)
{
char sTeamName[8];
GetCmdArg(1, sTeamName, sizeof(sTeamName)) ;// Get Team Name
int team = StringToInt(sTeamName);
if (team == CS_TEAM_SPEC) // Spectator
{
//Do stuff
}
else if(team == CS_TEAM_TERRORIST) // Terrorist
{
//Do stuff
}
else // Counter-Terrorist
{
//Do stuff
}
return Plugin_Continue;
}