If someone could please help me edit this plugin I would be extremely appreciated. I have tried & tried to edit this myself, and I can only get it to to set the settings once, instead of detecting the correct human teams, and setting the settings correctly.
PHP Code:
#include < amxmodx >
#include < cstrike >
new g_iRounds
new g_pSwitchAfter
public plugin_init( )
{
register_plugin( "TeamSwitcher", "1.0", "Battousai-sama" )
register_logevent( "LogeventEndRound", 2, "1=Round_End" )
g_pSwitchAfter = register_cvar( "amx_switch_after", "2" )
}
public LogeventEndRound( )
{
if ( g_iRounds++ > get_pcvar_num( g_pSwitchAfter ) )
{
new iPlayers[ 32 ]
new iNum
get_players( iPlayers, iNum )
for ( new a = 0; a < iNum; a++ )
switch ( cs_get_user_team( iPlayers[ a ] ) )
{
case 1:
cs_set_user_team( iPlayers[ a ], CS_TEAM_CT )
case 2:
cs_set_user_team( iPlayers[ a ], CS_TEAM_T )
}
g_iRounds = 0
return
}
g_iRounds++
}
The 2 settings I need set are "ajc_team <1|2>" & "pb_bot_join_team <ct|t>"
I need this set in a way, that when the plugin switches the human teams to CT, ajc_team = 2 and pb_bot_join_team = T, and when the plugin changes the human teams to T ajc_team = 1 and pb_bot_join_team = CT