I think the reason ist that the creator of this plugin don't want to set the teamjoin at 1... when you chosen the TerrorTeam...
Code:
public TeamSelectMenu_Handler( id, iKey )
{
new CsTeams:iTeam = cs_get_user_team( id );
CountTeams();
switch( iKey )
{
case 0: // Join NC (Terrorists)
{
client_print( id, print_chat, "%s You cannot join the Night-Crawler team!", g_szPrefix );
set_task( 0.1, "task_JoinTeam", id );
return PLUGIN_HANDLED;
}
case 1: // Join Humans (CTs)
{
if( iTeam == TEAM_HUMAN )
return PLUGIN_HANDLED;
if( task_exists( TASK_STARTGAME ) )
ForceTeam( id, TEAM_HUMAN );
else
{
CountTeams();
// ( Percent * Total Players / 100 ) - Current Amount of NCs
new iNeeded = get_pcvar_num( g_pNightcrawlerRatio ) * ( g_iTeamCount[ TEAM_NC ] + g_iTeamCount[ TEAM_HUMAN ] ) / 100 - g_iTeamCount[ TEAM_NC ];
if( iNeeded == 0 && g_iTeamCount[ TEAM_HUMAN ] == 1 )
iNeeded = 1;
if( iNeeded >= 1 )
ForceTeam( id, TEAM_NC );
else ForceTeam( id, TEAM_HUMAN );
}
return PLUGIN_HANDLED;
}
case 5:
{
user_silentkill( id );
ForceTeam( id, CS_TEAM_SPECTATOR );
return PLUGIN_HANDLED;
}
}
return PLUGIN_HANDLED;
}
public task_JoinTeam( id )
{
cs_set_user_team( id, CS_TEAM_CT );
}
public ForceTeam( id, CsTeams:iTeam )
{
static iRestore, iVGUI, iMSGBlock;
iRestore = get_pdata_int( id, m_iVGUI );
iVGUI = iRestore & ( 1 << 0 );
if( iVGUI )
set_pdata_int( id, m_iVGUI, iRestore & ~( 1 << 0 ) );
switch( iTeam )
{
case CS_TEAM_SPECTATOR:
{
iMSGBlock = get_msg_block( g_msgShowMenu );
set_msg_block( g_msgShowMenu, BLOCK_ONCE );
dllfunc( DLLFunc_ClientPutInServer, id );
set_msg_block( g_msgShowMenu, iMSGBlock );
set_pdata_int( id, m_fGameHUDInitialized, 1 );
engclient_cmd( id, "jointeam", "6" );
}
case CS_TEAM_T, CS_TEAM_CT:
{
iMSGBlock = get_msg_block( g_msgShowMenu );
set_msg_block( g_msgShowMenu, BLOCK_ONCE );
engclient_cmd( id, "jointeam", ( iTeam == CS_TEAM_CT ) ? "2" : "1" );
engclient_cmd( id, "joinclass", "1" );
set_msg_block( g_msgShowMenu, iMSGBlock );
}
}
if( iVGUI )
set_pdata_int( id, m_iVGUI, iRestore );
}
This is the part for teamjoin and teamforce, the teamforce works fine "IF" the players go into the CT team... but they dont do it! If they dont know that they "must" go into ct they usw auto or terrorist...
So i think the creator thougt mhm block the team with a 0 and so its ever false, but its buggy becase if you use the terrorist team you have to reconnect and go to ct first then the gameplay starts! If you dont reconnect and just go to CT you just came into the game and nothing else happens...
@ Liverwiz
Nothing like this what you add, just this here:
Code:
#define TEAM_MENU "#Team_Select"
#define TEAM_MENU2 "#Team_Select_Spect"
#define TEAM_NC CS_TEAM_T
#define TEAM_HUMAN CS_TEAM_CT
//then later....
new g_iTeamCount[ CsTeams ];
// then later
register_clcmd( "jointeam", "CmdJoinTeam" );
register_clcmd( "joinclass", "CmdJoinTeam" );
// then this...
register_menucmd( register_menuid( "Team_Select", 1 ), MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_5 | MENU_KEY_6, "TeamSelectMenu_Handler" );
Thats it, not more...
I also know in another plugin like this, the payers connect and dont get any menu, they just join the ct team automatic, there is no menu available. But i need the menu to give the player the chance to go spec when there is a cheater online to record and also report him to us!
To set it to "case 1" don't work, it brokes the team join action, if it set to 1 you can just join spectator nothing else...
Ive tried to fix it in the CountTeams function too, but nothing happens than before where i set "case 0" to "case 1"
__________________