AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Bot Plugin (https://forums.alliedmods.net/showthread.php?t=293093)

PurposeLess 01-22-2017 14:17

Bot Plugin
 
Hello guys,
First I want bot for CS 1.6 like spec bots, but the bot i wanna, is going to be in Counter Terrorist team.
The Bot (It) won't be in Spec. And when the round start, it will spawn and be like real players, be seems 'em.

For ain't understands;

There is bot in Counter Terrorist Team. [Not Spec]. I wanna let it be like real players. People will never understand "It's bot"
So, It'll be like AFK Players. :)

Please help me.

------------------------------------------------------- Turkish translate
Merhaba arkadaşlar,
Öncelikle Ben izleyicideki botlar gibi bir bot istiyorum ama istediğim bot counter terrorist takımında olacak.
Bot izleyicide (spec) olmayacak. Round başladığında doğacak ve gerçek oyuncular gibi olacak, onlar gibi görünecek.
CT takımında olacak. Gerçek oyuncular gibi görünecek. İnsanlar onun bot olduğunu anlamayacak.
Yani afk oyuncular gibi olacak

|

PHP Code:

/* Spect Bot v1.2

My Plugins: http://skape69ta.clan.su/load/11
My Profile: http://amxmodx.su/forum/memberlist.php?mode=viewprofile&u=455
My Skype: SKAJIbnEJIb619

Light version fakefull_original

Cvars:
Èìÿ áîòà
sbot_name "Spect Bot"

Áîòà íå ñìîãóò êèêíóòü/çàáàíèòü àäìèíû
sbot_immunity "1"

Àâòîìàòè÷åñêè óáèðàòü áîòà, åñëè ñåðâåð ïîëîí
sbot_auto "1"
*/

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>

new const Plugin[] = "Spect Bot"
new const Version[] = "1.2"
new const Author[] = "SKAJIbnEJIb & Bos93"

new g_BotNameg_Immunityg_Auto
new g_Bot

public plugin_init()
{
    
register_plugin(PluginVersionAuthor)

    
g_BotName register_cvar("sbot_name","Spect Bot")
    
g_Auto register_cvar("sbot_auto","1")
    
g_Immunity register_cvar("sbot_immunity","1")

    
set_task(10.0"ServerStatus"777__"b")
}

public 
createBot()
{
    new 
BotName[32]

    
get_pcvar_string(g_BotNameBotNamecharsmax(BotName))
    
g_Bot engfunc(EngFunc_CreateFakeClientBotName)

    if (
g_Bot 0
    {
        
dllfunc(MetaFunc_CallGameEntity"player"g_Bot)
        
set_pev(g_Botpev_flagsFL_FAKECLIENT)

        
set_pev(g_Botpev_model"")
        
set_pev(g_Botpev_viewmodel2"")
        
set_pev(g_Botpev_modelindex0)

        
set_pev(g_Botpev_renderfxkRenderFxNone)
        
set_pev(g_Botpev_rendermodekRenderTransAlpha)
        
set_pev(g_Botpev_renderamt0.0)

        
set_team(g_Bot)
        if (
get_pcvar_num(g_Immunity))
            
set_user_flags(g_BotADMIN_IMMUNITY)
    }
    else
        
log_amx ("[Spect Bot] Error!")

    return 
PLUGIN_CONTINUE
}

public 
removeBot(Bot)
{
    
server_cmd("kick #%d"get_user_userid(Bot))
    
g_Bot 0
}

public 
set_team(Bot)
{
    if (
cstrike_running()) {
        
cs_set_user_team(BotCS_TEAM_CT)
    }
}

public 
ServerStatus()
{
    if (
get_pcvar_num(g_Auto)) 
    {
        if(
is_user_connected(g_Bot))
        {
            if(
get_playersnum(1) > (get_maxplayers() - 2)) 
                
removeBot(g_Bot)
        }
        else
        {
            if(
get_playersnum(1)+get_maxplayers()) 
                
createBot()
        }
    }
    else
    {
        if(
is_user_connected(g_Bot))
            
createBot()
    }

    if(
is_user_connected(g_Bot))
    {
        
set_team(g_Bot)

        if (
get_user_team(g_Bot) > 0) {
            
server_cmd("kick #%d"get_user_userid(g_Bot))
            
createBot()
        }
    }



MaXs 01-22-2017 16:34

Re: Bot Plugin
 
better download real bots or POD Bots, sorry if im wrong.

SpannerSpammer 01-23-2017 00:54

Re: Bot Plugin
 
Your Bot creation code is incomplete. Use this code snippet from
the kz_dajrokan plugin as a template to spawn a bot in CS:
Code:

public mi_bot_connect()
{
    if (!bot_id)
    {
        bot_id = engfunc(EngFunc_CreateFakeClient, BOT_NAME)
        new ptr[128]
        dllfunc(DLLFunc_ClientConnect, bot_id, BOT_NAME, "127.0.0.1", ptr)
        dllfunc(DLLFunc_ClientPutInServer, bot_id)
        cs_set_user_team(bot_id, CS_TEAM_CT, CS_CT_URBAN)
        dllfunc(DLLFunc_Spawn, bot_id)
        set_pev(bot_id, pev_effects, (pev(bot_id, pev_effects) | 128))
        set_pev(bot_id, pev_solid, 0)
        bot_userid = get_user_userid(bot_id)
        set_user_origin(bot_id, origo)
    }

    return PLUGIN_CONTINUE
}


PurposeLess 01-23-2017 06:08

Re: Bot Plugin
 
@SpannerSpammer

Can you help me plz ? I couldn't finish the plugin?
etc. what is origo ?

Can you give me "plugin who finished" ?
Thanks for helps :)

edon1337 01-23-2017 13:19

Re: Bot Plugin
 
origo is the variable in which the origin is stored.

SpannerSpammer 01-23-2017 16:33

Re: Bot Plugin
 
@PurposeLess

Sorry, I'm not a CS coder, I can't really help you with this.

The code snippet I gave you was just to show you how it's
done, you have to modify it and merge it with your own code.

yas17sin 01-24-2017 08:05

Re: Bot Plugin
 
here is what you want : https://forums.alliedmods.net/showthread.php?t=293059
:).

PurposeLess 01-25-2017 09:16

Re: Bot Plugin
 
@yas17sin

It's not thing I wanna. The bot will spawn in round start and stay put like afk players.
But It'll never be in the air. Nobody will understand this is bot and I wanna ping to bots.

Shortly I wanna it will be like this.

http://1.bp.blogspot.com/-ddk7qxowyl...tem+Player.jpg

It will have ping in score.And While it spawn, it will be like in this photo. We can hit it. While we kill it, it die like normal players

yas17sin 01-25-2017 09:36

Re: Bot Plugin
 
the bot link i give you the bot can be in team.
but they can't spawn as normal player and they don't have ping but at least they can be in teams.

just edit it the plugin and make the things you want with !

MaXs 01-25-2017 10:32

Re: Bot Plugin
 
Download fakeplayer thing and use it :D


All times are GMT -4. The time now is 20:55.

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