Raised This Month: $ Target: $400
 0% 

Check CT Reconnect


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 10-19-2014 , 14:27   Check CT Reconnect
Reply With Quote #1

Code:
/* 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 );
Can anyone add to this code, check if someone were was CT team and did ​​Reconnect then re-entered again to CT team will automatic moved to terrorist?

Sorry for my English
Snitch is offline
Send a message via Skype™ to Snitch
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode