Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

PodBot Manager


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
PHP Code:

#include <amxmodx>

new const Version[] = "0.2";

enum PlayerCount
{
    
HumanCount,
    
BotCount
}

new 
g_PlayerCountsPlayerCount ] , g_RoundEnd;
new 
g_pMaxBots;

new const 
g_BotsNeeded32 ] = 
{
    
0// 0 humans
    
5// 1 humans
    
5// 2 humans
    
5// 3 humans
    
5// 4 humans
    
5// 5 humans
    
5// 6 humans
    
5// 7 humans
    
4// 8 humans
    
4// 9 humans
    
3// 10 humans
    
2// 11 humans
    
1  // 12 humans 
       // 13-32 humans = 0 bots
}


public 
plugin_init() 
{
    
register_plugin"PodBot Manager"Version "bugsy" );
    
    
register_logevent"RoundEnd" "1=Round_End" );
    
    
server_cmd"pb removebots" );
    
    
set_cvar_num"pb_bot_quota_match" );
    
set_cvar_num"pb_minbots" );
    
set_pcvar_num( ( g_pMaxBots get_cvar_pointer"pb_maxbots" ) ) , g_BotsNeeded] );
}

public 
client_authorizedid )
{
    
g_PlayerCountsPlayerCount:is_user_botid ) ]++;
    
    
//Handle bots on map change
    
if ( !g_RoundEnd )
    {
        
set_task5.0 "BalanceBots" );
        
g_RoundEnd get_systime();
    }
}

public 
client_disconnected(idbool:dropMsg[], Len)   
{
    
g_PlayerCountsPlayerCount:is_user_botid ) ]--;
}

public 
RoundEnd()
{
    if ( ( 
get_systime() - g_RoundEnd ) > )
    {
        
BalanceBots();
    }
    
    
g_RoundEnd get_systime();
}

public 
BalanceBots()
{
    new 
iNumBots g_PlayerCountsBotCount ];
    new 
iNumHumans g_PlayerCountsHumanCount ];
    new 
iBotsNeeded g_BotsNeedediNumHumans ];
    new 
szName32 ] , iBots32 ] , iBotCount i;
    
    
set_pcvar_numg_pMaxBots iNumHumans iBotsNeeded );
    
    if ( 
iNumBots iBotsNeeded )
    {
        
get_playersiBots iBotCount "d" );
        
        while ( 
iNumBots-- > iBotsNeeded )
        {
            
get_user_nameiBotsi++ ] , szName charsmaxszName ) );
            
server_cmd"pb remove ^"%s^"" szName );
        }
    }
    else if ( 
iNumBots iBotsNeeded )
    {
        while ( 
iNumBots++ < iBotsNeeded )
        {
            
server_cmd"pb add" );
        }
    }


Could someone please help me edit this to work with CSDM. As it is written bot balancing occurs at round end or after first player join on map change/server start. Deathmatch doesn't have rounds.

Please help and thanks.

Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

×
×
  • Dodaj nową pozycję...