im using this code to switch player to spec but for some reason its glitching. it switches the player to spec for 5 seconds and then switches them back to their old team. when u tab it shows ur on ur old team but ur really in spec and wont spawn next round or round after that. any1 know why the score board is glitching heres the code
Code:
stock fm_set_user_team(id, CsTeams:team)
{
set_pdata_int(id, OFFSET_TEAM, _:team)
dllfunc(DLLFunc_ClientUserInfoChanged, id)
static teaminfo[12], iMsgid_TeamInfo
switch(team)
{
case CS_TEAM_UNASSIGNED:
teaminfo="UNASSIGNED"
case CS_TEAM_T:
teaminfo="TERRORIST"
case CS_TEAM_CT:
teaminfo="CT"
case CS_TEAM_SPECTATOR:
teaminfo="SPECTATOR"
}
if(!iMsgid_TeamInfo)
iMsgid_TeamInfo = get_user_msgid("TeamInfo")
message_begin(MSG_ALL, iMsgid_TeamInfo)
write_byte(id)
write_string(teaminfo)
message_end()
}