Raised This Month: $ Target: $400
 0% 

learn to talk boats


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
F4RR3LL
Member
Join Date: Jun 2008
Location: Russia :)
Old 01-29-2010 , 19:12   learn to talk boats
Reply With Quote #1

it is necessary to make so that time in X seconds boats for CT and T to a chat wrote the certain message

has tried to make through client_cmd - it has not turned out

code in which it is necessary to thrust function:
Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>

new botIds[3]

new const botnames[sizeof botIds][] =
{
    "TE [CSDM]", // t
    "CT [CSDM]", // ct
    "Advert bot" // spec
}

new gmsgScoreInfo

public plugin_init() 
{
    register_plugin("Fake TeamBot", "1.0", "OneEyed")
    
    gmsgScoreInfo = get_user_msgid("ScoreInfo")
    
    register_event("HLTV", "StartRound", "a", "1=0", "2=0")
}

public plugin_cfg()
{
    set_task(1.0, "createBots")
}

public StartRound()
{
    set_task(0.5, "PostStartRound")
}

public PostStartRound()
{
    new i, bot
    
    for(;i<sizeof botIds;i++)
    {
        bot = botIds[i]
        
        set_pev(bot, pev_origin, Float:{9999.0, 9999.0, 9999.0})
        
        fm_set_user_frags(bot, -1)
        fm_set_user_deaths(bot, -1)
        
        if(!(pev(bot, pev_effects) | EF_NODRAW))
            set_pev(bot, pev_effects, pev(bot, pev_effects) | EF_NODRAW )
        
        set_pev(bot, pev_solid, SOLID_NOT)
        set_pev(bot, pev_takedamage, DAMAGE_NO)
    }
}

public createBots()
{
    new bot, i, ptr[128]
    
    for(;i<sizeof botIds;i++)
    {
        if((bot = find_player("bli", botnames[i])))
        {
            botIds[i] = bot
            
            continue
        }
        
        botIds[i] = bot = engfunc(EngFunc_CreateFakeClient, botnames[i])
        
        dllfunc(DLLFunc_ClientConnect, bot, botnames[i], "127.0.0.1", ptr)
        
        dllfunc(DLLFunc_ClientPutInServer, bot)
        
        set_pev(bot, pev_flags, pev(bot, pev_flags) | FL_FAKECLIENT)
        
        set_pev(bot, pev_solid, SOLID_NOT)
        
        set_pev(bot, pev_takedamage, DAMAGE_NO)
        
        set_pev(bot, pev_effects, pev(bot, pev_effects) | EF_NODRAW)
        
        switch(i)
        {
            case 0: cs_set_user_team(bot, CS_TEAM_T, CS_T_TERROR)
            case 1: cs_set_user_team(bot, CS_TEAM_CT, CS_CT_URBAN)
            case 2: cs_set_user_team(bot, CS_TEAM_SPECTATOR)
        }
        
        set_pev(bot, pev_origin, Float:{9999.0, 9999.0, 9999.0})
        
        fm_set_user_frags(bot, -1)
        fm_set_user_deaths(bot, -1)
    }
}

#if cellbits == 32
    #define OFFSET_TEAM 114
#else
    #define OFFSET_TEAM 139
#endif

#define OFFSET_CSDEATHS 444

stock fm_set_user_frags(id, newfrags)
{
    new deaths = get_pdata_int(id, OFFSET_CSDEATHS)
    
    set_pev(id, pev_frags, float(newfrags))
    
    message_begin(MSG_ALL, gmsgScoreInfo)
    write_byte(id)
    write_short(newfrags)
    write_short(deaths)
    write_short(0)
    write_short(get_pdata_int(id, OFFSET_TEAM))
    message_end()
}

stock fm_set_user_deaths(id, newdeaths)
{
    new Float:frags
    pev(id, pev_frags, frags)

    set_pdata_int(id, OFFSET_CSDEATHS, newdeaths)

    message_begin(MSG_ALL, gmsgScoreInfo)
    write_byte(id)
    write_short(floatround(frags))
    write_short(newdeaths)
    write_short(0)
    write_short(get_pdata_int(id, OFFSET_TEAM))
    message_end()
}
thanks
__________________

F4RR3LL is offline
F4RR3LL
Member
Join Date: Jun 2008
Location: Russia :)
Old 01-30-2010 , 12:53   Re: learn to talk boats
Reply With Quote #2

Code:
message_begin(MSG_ALL, get_user_msgid("SayText"))
        write_byte(botIds[i])
        write_string("#Cstrike_Chat_All")
        write_string("")
        write_string("I am Bot2")
        message_end()
close
__________________

F4RR3LL is offline
Reply



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 01:55.


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