In case you might refer to what Brreaker said..
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define ACCESS ADMIN_BAN // your access level
#define isPlayer(%1) (1 <= %1 <= get_maxplayers())
new bool:g_bClientBanned[32];
public plugin_init()
{
register_plugin("Ban for Joining CT Team", "0.0.1", "benamo6");
register_event("TextMsg", "eJoiningCT", "b", "2=#Cstrike_TitlesTXT_Game_join_ct");
register_concmd("amx_ctban", "_ctBan", ACCESS, "<nickname> <status> - sets whether <nickname> can join the CT team or not");
}
public _ctBan(id, level, cid)
{
if(!cmd_access(id, level, cid, 3))
{
return PLUGIN_HANDLED;
}
new szNickname[32], szStatus[2];
new iStatus, iTarget;
read_argv(1, szNickname, 31);
read_argv(2, szStatus, 1);
iStatus = str_to_num(szStatus);
iTarget = cmd_target(id, szNickname, 8);
if(!iTarget || !isPlayer(iTarget))
{
return PLUGIN_HANDLED;
}
if(iStatus == 1)
{
g_bClientBanned[iTarget] = true;
}
else
{
g_bClientBanned[iTarget] = false;
}
return PLUGIN_HANDLED;
}
public eJoiningCT(id)
{
if(g_bClientBanned[id] == true)
{
client_print(id, print_chat, "* You have been banned from joining the CT Team.");
client_print(id, print_chat, "* You have been moved to SPECTATORS.");
}
_moveToSpec(id);
}
_moveToSpec(id)
{
cs_set_user_team(id, CS_TEAM_SPECTATOR);
}
..Hope that will do the trick!
Non-tested!
__________________