Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include < amxmodx >
- #include < fakemeta >
- enum _: FmTeams
- {
- FM_TEAM_UNASSIGNED,
- FM_TEAM_T,
- FM_TEAM_CT,
- FM_TEAM_SPEC
- }
- new g_pTeam, g_iMaxPlayers;
- public plugin_init( )
- {
- register_plugin( "Teams Balancer", "v1.0", "+ColdWar" )
- g_pTeam = get_cvar_pointer( "humans_join_team" );
- g_iMaxPlayers = get_maxplayers( ) ;
- }
- public client_putinserver( client )
- {
- static g_iTeams[ FmTeams ];
- for( new i = 0 ; i < FmTeams ; i ++ )
- g_iTeams[ i ] = 0;
- for( new i = 1 ; i <= g_iMaxPlayers ; i ++ )
- {
- if( !is_user_connected( i ) )
- continue;
- g_iTeams[ FM_GetUserTeam( i ) ] ++;
- }
- set_pcvar_string( g_pTeam, GetTeam( g_iTeams ) );
- }
- stock GetTeam( g_iTeams[ FmTeams ] )
- {
- new szBuffer[ 4 ] = "any";
- if( g_iTeams[ FM_TEAM_CT ] < g_iTeams[ FM_TEAM_T ] )
- szBuffer = "ct"
- else if( g_iTeams[ FM_TEAM_CT ] > g_iTeams[ FM_TEAM_T ] )
- szBuffer = "t"
- return szBuffer;
- }
- stock FM_GetUserTeam( client )
- return get_pdata_int( client, 114 );
Advertisement
Add Comment
Please, Sign In to add comment