Raised This Month: $32 Target: $400
 8% 

Spec Bot


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ArminC
Senior Member
Join Date: Apr 2016
Old 03-01-2018 , 08:50   Spec Bot
Reply With Quote #1

I need a plugin to add about 2 bots on spec..

1. To be undetectable on GameTracker
2. To be cutomizable
3. To kick bots at x players on..

-- and a good code..

Thanks
ArminC is offline
Saint Sinner
Senior Member
Join Date: Feb 2016
Old 03-01-2018 , 09:14   Re: Spec Bot
Reply With Quote #2

3 players undetected

https://forums.alliedmods.net/showth...54620?p=254620

Last edited by Saint Sinner; 03-01-2018 at 09:15.
Saint Sinner is offline
ArminC
Senior Member
Join Date: Apr 2016
Old 03-01-2018 , 10:03   Re: Spec Bot
Reply With Quote #3

Thanks for reply.. but I saw it.. it's old.. I want something newer..
ArminC is offline
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 03-02-2018 , 13:16   Re: Spec Bot
Reply With Quote #4

Use kgbbots
Alber9091 is offline
Saint Sinner
Senior Member
Join Date: Feb 2016
Old 03-02-2018 , 16:30   Re: Spec Bot
Reply With Quote #5

Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
 
#define PLUGIN  "botespectador"
#define AUTHOR  "_|Polimpo4|_"
#define VERSION "1.0"
 
new szname_bot[] = "KNIFE.ALBASTREL.RO";                   ////////// NOME BOT 1
new szname_bot2[] = "HAVE FUN & GOOD LUCK";             ////////// NOME BOT 2
new szname_bot3[] = "PRIVATE PLUGINS";            ////////// NOME BOT 3
 
new bool:bot_on, bot_id;
new bool:bot_on2, bot_id2;
new bool:bot_on3, bot_id3;
 
//Cvars
new cv_KickBots, cv_ConnectBots
 
public plugin_init()
{
    register_plugin("botespectador", "1.0", "_|Polimpo4|_");
    
    cv_KickBots = register_cvar("cv_KickBots","16", FCVAR_SERVER | FCVAR_ARCHIVE);                 
    cv_ConnectBots = register_cvar("cv_ConnectBots","16", FCVAR_SERVER | FCVAR_ARCHIVE);
    
    bot_on=false;
    bot_on2=false;
    bot_on3=false;
    bot_id=0;
    bot_id2=0;
    bot_id3=0;
    set_task(1.4,"fake_make");
    set_task(1.4,"fake_make2");
    set_task(1.4,"fake_make3");
    return PLUGIN_CONTINUE
}
 
public fake_make()
{    
    new rj[128];
    if((!bot_on)&&(!bot_id))
    {
        bot_id=engfunc(EngFunc_CreateFakeClient,szname_bot);
        if(bot_id > 0)
        {
            engfunc(EngFunc_FreeEntPrivateData,bot_id);
            dllfunc(DLLFunc_ClientConnect,bot_id,szname_bot,"20.05.45.45.2",rj);
            if(is_user_connected(bot_id))
            {
                dllfunc(DLLFunc_ClientPutInServer, bot_id);
                set_pev(bot_id,pev_spawnflags,pev(bot_id,pev_spawnflags)|FL_FAKECLIENT);
                set_pev(bot_id,pev_flags,pev(bot_id,pev_flags)|FL_FAKECLIENT);
                cs_set_user_team(bot_id, CS_TEAM_SPECTATOR);
                bot_on = true;
            }        
        }        
    }
   
    return PLUGIN_CONTINUE;    
}  
 
public fake_make2()
{    
    new rj[128];
    if((!bot_on2)&&(!bot_id2))
    {
        bot_id2=engfunc(EngFunc_CreateFakeClient,szname_bot2);
        if(bot_id2 > 0)
        {
            engfunc(EngFunc_FreeEntPrivateData,bot_id2);
            dllfunc(DLLFunc_ClientConnect,bot_id2,szname_bot2,"20.05.45.45.2",rj);
            if(is_user_connected(bot_id2))
            {
                dllfunc(DLLFunc_ClientPutInServer, bot_id2);
                set_pev(bot_id2,pev_spawnflags,pev(bot_id2,pev_spawnflags)|FL_FAKECLIENT);
                set_pev(bot_id2,pev_flags,pev(bot_id2,pev_flags)|FL_FAKECLIENT);
                cs_set_user_team(bot_id2, CS_TEAM_SPECTATOR);
                bot_on2 = true;
            }        
        }        
    }
   
    return PLUGIN_CONTINUE;    
}  
public fake_make3()
{    
    new rj[128];
    if((!bot_on3)&&(!bot_id3))
    {
        bot_id3=engfunc(EngFunc_CreateFakeClient,szname_bot3);
        if(bot_id3 > 0)
        {
            engfunc(EngFunc_FreeEntPrivateData,bot_id3);
            dllfunc(DLLFunc_ClientConnect,bot_id3,szname_bot3,"20.05.45.45.2",rj);
            if(is_user_connected(bot_id3))
            {
                dllfunc(DLLFunc_ClientPutInServer, bot_id3);
                set_pev(bot_id3,pev_spawnflags,pev(bot_id3,pev_spawnflags)|FL_FAKECLIENT);
                set_pev(bot_id3,pev_flags,pev(bot_id3,pev_flags)|FL_FAKECLIENT);
                cs_set_user_team(bot_id3, CS_TEAM_SPECTATOR);
                bot_on3 = true;
            }        
        }        
    }
   
    return PLUGIN_CONTINUE;    
}
 
public client_disconnect(id)
{
    new players[32], num
    get_players(players, num, "c" )

    new szConnectBots = get_pcvar_num(cv_ConnectBots)
    
    if(num < szConnectBots && !bot_on)
    {
        fake_make()
        fake_make2()
        fake_make3()    
    }   
}
 
public client_connect(id)
{
    new players[32], num
    get_players(players, num, "c" )
 
    new szKickBots = get_pcvar_num(cv_KickBots)
 
    if(num >= szKickBots && bot_on)
    {
        bot_on = false 
        bot_on2 = false 
        bot_on3 = false     
        bot_id=0
        bot_id2=0
        bot_id3=0   
        server_cmd("kick ^"%s^"", szname_bot); 
        server_cmd("kick ^"%s^"", szname_bot2); 
        server_cmd("kick ^"%s^"", szname_bot3); 
    }
}
Saint Sinner is offline
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 03-03-2018 , 03:58   Re: Spec Bot
Reply With Quote #6

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

enum Cvars
{
    
botname1,
    
botname2,
    
minplayers,
    
starttime,
    
endtime,
    
onecon,
    
onebot,
    
norounds
};

new const 
cvar_namesCvars ][] =
{
    
"amx_botname",
    
"amx_botname2",
    
"amx_minplayers",
    
"amx_starttime",
    
"amx_endtime",
    
"amx_onecon",
    
"amx_onebot",
    
"amx_norounds"
};

new const 
cvar_defaultsCvars ][] =
{
    
"Bot",
    
"Bot 2",
    
"10",
    
"00",
    
"12",
    
"0",
    
"0",
    
"0"
};

new 
cvar_pointerCvars ];
new 
bool:g_isTime false;
new 
bool:g_ePlayers false;
new 
bool:g_isFirstRound true;
new 
g_BotNum 0g_maxplayersg_bID1g_bID2;

new const 
g_ConfigFile[] = "addons/amxmodx/configs/kgbbots.cfg"

public plugin_init() 
{
    
register_plugin("KGB Bots""2.3""OvidiuS & Desikac")
    
register_cvar("kgbbots""1" , (FCVAR_SERVER|FCVAR_SPONLY))
    
    
register_logevent("Event_RoundEnd"2"1=Round_End");
    
register_event("HLTV""Event_NewRound""a""1=0""2=0");
    
    for ( new 
Cvars:botname1 Cvars i++ )
        
cvar_pointer] = register_cvarcvar_names] , cvar_defaults] );
    
    
g_maxplayers get_maxplayers();
    
server_cmd("exec %s"g_ConfigFile)
    
set_task(3.0"isit")
}

public 
isit() {
    if(
get_pcvar_num(cvar_pointer[norounds]))
        
set_task(30.0"CheckConditions",0,"",0,"b")
}

public 
plugin_precache() 
{
    if(!
file_exists(g_ConfigFile)) 
    {
        
write_file(g_ConfigFile"KGB Bots - Settings^n")
        
write_file(g_ConfigFile"amx_botname ^"Bot1^"   //First Bot Name")
        
write_file(g_ConfigFile"amx_botname2 ^"Bot2^"   //The Name of another Bot")
        
write_file(g_ConfigFile"amx_minplayers ^"10^"   //Bots will only be dropped if the number of players is smaller than this value.")
        
write_file(g_ConfigFile"amx_starttime ^"0^"   //How many hours are the bots on the server?")
        
write_file(g_ConfigFile"amx_endtime ^"24^"   //How many hours do the bots be on the server?)
        write_file(g_ConfigFile, "
amx_onecon ^"0^"   //Should only one condition be met to add bots?")
        
write_file(g_ConfigFile"amx_onebot ^"0^"   //Does plugin use only one Bot?")
        
write_file(g_ConfigFile"amx_norounds ^"0^"   //Does not this round end on this server?")
    }
}

public 
Event_RoundEnd()
{
    if (!
g_isFirstRound)
        return;
 
    
g_isFirstRound false;
}

public 
Event_NewRound()
{
    if(
g_isFirstRound)
        return;
        
    
CheckConditions();
}

public 
CheckConditions()
{
    static 
iHoursms
    time
(iHoursms)

    new 
iMin get_pcvar_num(cvar_pointerstarttime ]);
    new 
iMax get_pcvar_num(cvar_pointerendtime ]);
    
    if(
iMin == iMax)
        
g_isTime true;
    else if(
iMin iMax
    {
        switch(
iHours
        {
            case 
0..11
            {
                if(
iMin >= iHours && iMax iHours)
                    
g_isTime true;
            }
            case 
12..23
            {
                if(
iMin <= iHours && iMax iHours)
                    
g_isTime true;
            }
        }
    }
    else if(
iMin <= iHours && iMax iHours)
        
g_isTime true;
    else 
        
g_isTime false;
        
    new 
iNumiPlayers[32];
    
get_players(iPlayersiNum"c");
    
    if(
iNum <= get_pcvar_num(cvar_pointer[minplayers]))
        
g_ePlayers true;
    else
        
g_ePlayers false;

    if(
g_maxplayers iNum 2)
        
g_ePlayers false;
    
    if(
get_pcvar_num(cvar_pointer[minplayers]) == 0)
        
g_ePlayers true
    
    
new iCondition get_pcvar_num(cvar_pointeronecon ]);
    if( (!
g_ePlayers && g_isTime || !g_isTime && g_ePlayers) && iCondition
    {
        
g_isTime true;
        
g_ePlayers true;
    }
    
    
        
    if((
g_isTime && g_ePlayers) && !g_BotNum)
    {
        if(!
get_pcvar_num(cvar_pointer[onebot]))
            
set_task(1.5"Task_AddBot")
        
set_task(2.8"Task_AddBot")
    }
    else if((!
g_isTime || !g_ePlayers) && g_BotNum <= )
    {
        
g_BotNum 0;
        
server_cmd("kick #%d"g_bID1)
        
server_cmd("kick #%d"g_bID2)
    }
}

public 
Task_AddBot()
{
    static 
iBot;
    new 
iBotName[35];
    
    switch(
g_BotNum)
    {
        case 
0get_pcvar_string(cvar_pointerbotname1 ], iBotNamecharsmaxiBotName ));
        case 
1:    get_pcvar_string(cvar_pointerbotname2 ], iBotNamecharsmaxiBotName ));
        case 
2: return;
    }

    
iBot engfuncEngFunc_CreateFakeClientiBotName );
    
    if(!
iBot)
        return;
        
    
dllfuncMetaFunc_CallGameEntity"player"iBot );
    
set_peviBotpev_flagsFL_FAKECLIENT );

    
set_peviBotpev_model"" );
    
set_peviBotpev_viewmodel2"" );
    
set_peviBotpev_modelindex);

    
set_peviBotpev_renderfxkRenderFxNone );
    
set_peviBotpev_rendermodekRenderTransAlpha );
    
set_peviBotpev_renderamt0.0 );

    
set_pdata_intiBot114);
    
cs_set_user_teamiBotCS_TEAM_UNASSIGNED );
    
    switch(
g_BotNum
    {
        case 
0g_bID1 get_user_userid(iBot);
        case 
1g_bID2 get_user_userid(iBot);
    }
    
g_BotNum++;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
configs/kgbbots.cfg

Code:
; KGB Bots - Settings

amx_botname "Bot1" // First Bot Name
amx_botname2 "Bot2" // The Name of another Bot
amx_minplayers "28" // Bots will only be dropped if the number of players is smaller than this value.
amx_starttime "00" // How many hours are the bots on the server?
amx_endtime "24" // How many hours do the bots be on the server?
amx_onecon "0" // Should only one condition be met to add bots?
amx_onebot "0" // Does plugin use only one Bot?
amx_norounds "0" // Does not this round end on this server?

Last edited by Alber9091; 03-03-2018 at 04:35.
Alber9091 is offline
ArminC
Senior Member
Join Date: Apr 2016
Old 03-03-2018 , 08:28   Re: Spec Bot
Reply With Quote #7

I have KGB Bot.. is ok.. but isn't there any bot plugin like for example: 10 players have 1 bot and at 5 players 2 bots (that can be changed in cvar) ?
ArminC is offline
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 03-03-2018 , 09:55   Re: Spec Bot
Reply With Quote #8

Someone has to edit this plugin then, so, both bots, appear separately on defined cvar.
Alber9091 is offline
Reply


Thread Tools
Display Modes

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 23:07.


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