.:: Bots United ::.  
filebase forums irc server wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps waypoints yapb

Go Back   .:: Bots United ::. > Cyborg Factory > YaPB
YaPB Yet another POD-Bot flavor by Whistler and Jeefo Counter-Strike

Reply
 
Thread Tools
[FIX] Better method for auto vacate.
Old
  (#1)
wbyokomo
Zombie Slayer
 
Status: Offline
Posts: 17
Join Date: Apr 2012
Location: Cyberjaya MY
Default [FIX] Better method for auto vacate. - 12-06-2016

I'm tired of auto vacate issue, it's not work as i want.

Here i attach a possible fix for this issue, but it was in pawn language, i hope you can convert to cpp language.

I have 0 knowledge about cpp.

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

#define PLUGIN "Yapb Quota Fix"
#define VERSION "0.0.1"
#define AUTHOR "wbyokomo"

//lets say this is yb_quota cvar
#define MAX_BOT 9

new iMaxClients

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
iMaxClients get_maxplayers()
    
    
register_forward(FM_ClientDisconnect"OnClientDisconnectPost"1)
}

public 
client_putinserver(id)
{
    
UTIL_BotQuota()
}

//yes we need to use post
public OnClientDisconnectPost(id)
{
    
UTIL_BotQuota()
}

UTIL_BotQuota()
{
    new 
iBotiHuman
    iHuman 
UTIL_CountHumans()
    
iBot MAX_BOT iHuman
    
if(iBot)
    {
        
//here we set our bot count (iBot) correctly.
    
}
    else
    {
        
//human count >= 9, so we dont need bots anymore, kick them all.
    
}
}

UTIL_CountHumans()
{
    new 
idiCount=0
    
for(id=1;id<=iMaxClients;id++)
    {
        
//count only connected human, not a bot or hltv.
        
if(is_user_connected(id) && !is_user_bot(id) && !is_user_hltv(id))
        {
            
iCount++
        }
    }
    
    return 
iCount;

With this method:
  • 1 bot will leave if 1 human join.
  • 1 bot will join if 1 human leave.
Max bot is decided by yb_quota value.. easy right?
   
Reply With Quote
Re: [FIX] Better method for auto vacate.
Old
  (#2)
jeefo
ouch
 
jeefo's Avatar
 
Status: Offline
Posts: 445
Join Date: Nov 2005
Location: Saint-Petersburg
Default Re: [FIX] Better method for auto vacate. - 22-06-2016

Hi! Yup, i can't test quota working right, i have no server with real player.

Can you please test some beta versions and give some feedback?
   
Reply With Quote
Re: [FIX] Better method for auto vacate.
Old
  (#3)
jeefo
ouch
 
jeefo's Avatar
 
Status: Offline
Posts: 445
Join Date: Nov 2005
Location: Saint-Petersburg
Default Re: [FIX] Better method for auto vacate. - 23-06-2016

http://rgho.st/8wwTqXZwp first attempt
   
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com