public team_join(id, CsTeams:team)
{
static restore, vgui, msgblock
restore = get_pdata_int(id, m_iVGUI)
vgui = restore & (1<<0)
if(vgui)
set_pdata_int(id, m_iVGUI, restore & ~(1<<0))
switch(team)
{
case CS_TEAM_SPECTATOR:
{
msgblock = get_msg_block(g_MsgShowMenu)
set_msg_block(g_MsgShowMenu, BLOCK_ONCE)
dllfunc(DLLFunc_ClientPutInServer, id)
set_msg_block(g_MsgShowMenu, msgblock)
set_pdata_int(id, m_fGameHUDInitialized, 1)
engclient_cmd(id, "jointeam", "6")
}
case CS_TEAM_T, CS_TEAM_CT:
{
msgblock = get_msg_block(g_MsgShowMenu)
set_msg_block(g_MsgShowMenu, BLOCK_ONCE)
engclient_cmd(id, "jointeam", (team == CS_TEAM_CT) ? "2" : "1")
engclient_cmd(id, "joinclass", "1")
set_msg_block(g_MsgShowMenu, msgblock)
g_PlayerSpect[id] = 0
}
}
if(vgui)
set_pdata_int(id, m_iVGUI, restore)
}