Thread: Server Players
View Single Post
Author Message
feren02
Senior Member
Join Date: Mar 2012
Old 08-23-2021 , 00:23   Server Players
Reply With Quote #1

Hi good day!

Hope everyone is coping during the pandemic times.

I was wondering if this would matter:

***I run latest YapB in my server and I want to add and kick bots every X***

1. (could be every certain rounds - e.g. every 7th, 15th, 28th round)
2. (could be every X server running time - e.g. every 7 mins or every 15 mins.)
3. (can be modified how many bots are kicked and how many bots are added during X)

Is this possible?

Tried doing these:

PHP Code:
#include <amxmodx>
#include <cstrike>

#define PLUGIN  "addkick"
#define VERSION "1.0"
#define AUTHOR  "nobody"

#define MSGID 81045

#if !defined MAX_PLAYERS
    
const MAX_PLAYERS 32;
#endif

enum _:ePlayerInfo
{
    
iTotalPlayers,
    
iCtPlayers,
    
iCtAlive,
    
iTerPlayers,
    
iTerAlive
};

new 
iInfo[ePlayerInfo];

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
}

public 
client_putinserver(id)
{
    
iInfo[iTotalPlayers]++;

    if(!
task_exists(MSGID))
    {
        
set_task(10.0"displayMessage"MSGID);
    }
}


#if AMXX_VERSION_NUM < 183
public client_disconnect(id)
#else
public client_disconnected(id)
#endif
{
    if( 
get_user_teamid ) == )
        
iInfoiCtPlayers ]--
    else if( 
get_user_teamid ) == )
        
iInfoiTerPlayers ]--

    if(
iInfoiCtPlayers ] + iInfoiTerPlayers ] == )
    {
        
remove_task(MSGID);
        
server_cmd("yb kick");
    }

-- in the 1st script above, my trial goal is to kick a bot when ct / t players are equivalent to 8 players combined. However nothing happens. What can be the problem?


------------------------------------------------------------


PHP Code:
#include < amxmodx >
#include < cstrike >
#include < fakemeta >

#define PLUGIN  "AddKick"
#define VERSION "1.0"
#define AUTHOR  "nobody"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
}

public 
New_Roundid 

    static 
iRoundCount 
    
++iRoundCount 
     
    
if(iRoundCount == 2)        // Restart on the 2nd round 
    

        
//iRoundCount = 0 
        
server_cmd("yb kick")
        
server_cmd("yb kick")
        
server_cmd("yb kick")
    } 



public 
New_Round2id 

    static 
iRoundCount 
    
++iRoundCount 
     
    
if(iRoundCount == 15)        // Restart on the 15th round 
    

        
iRoundCount 
        server_cmd
("yb add 4 1 5")
    } 


public 
New_Round3id 

    static 
iRoundCount 
    
++iRoundCount 
     
    
if(iRoundCount == 18)        // Restart on the 18th round 
    

        
iRoundCount 
        server_cmd
("yb add 4 1 5")
        
server_cmd("yb add 4 1 5")
        
server_cmd("yb add 4 1 5")
    } 


public 
New_Round4id 

    static 
iRoundCount 
    
++iRoundCount 
     
    
if(iRoundCount == 21)        // Restart on the 21st round 
    

        
iRoundCount 
        server_cmd
("yb kick")
        
server_cmd("yb kick")
    } 


public 
New_Round5id 

    static 
iRoundCount 
    
++iRoundCount 
     
    
if(iRoundCount == 24)        // Restart on the 24th round 
    

        
iRoundCount 
        server_cmd
("yb kick")
    } 

-- in the 2nd script I am doing, it aims to add or kick bots during X rounds, which is more easier. But still nothing happens in-game. What do I lack?



LOOKING FORWARD! Thank you!
feren02 is offline