Hello, I am trying to hook the team join event in order to kill the player and put him in spec if 'lockteams' is '1'. Only problem is when I enable 'lockteams' and spawn HLDS crashes..
My code:
PHP Code:
public plugin_init()
{
register_menucmd(register_menuid("CT_Select", 1), 511, "team_select")
register_menucmd(register_menuid("Terrorist_Select", 1), 511, "team_select")
}
public team_select(id)
{
if(lockteams == 1)
{
user_kill(id);
cs_set_user_team(id, CS_TEAM_SPECTATOR);
client_print(id, print_chat, "Team selection is disabled");
}
}
What am I doing wrong