#include <sourcemod>
#include <cstrike>

public Plugin:myinfo = 
{
	name = "Spec switch",
	author = "Jackmaster",
	description = "switches to spec",
	version = "1.0",
	url = "<- URL ->"
}

public OnPluginStart()
{
	RegConsoleCmd("sm_afk", afk);
}

public Action:afk(client, args)
{
	if (IsClientConnected(client))
	{
		if (GetClientTeam(client) != CS_TEAM_SPECTATOR)
		{
			ChangeClientTeam(client, 1)
			return Plugin_Handled
		}
	}
	return Plugin_Handled
}
		