AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [REQ] Fake Team Bot (https://forums.alliedmods.net/showthread.php?t=61473)

BioI-Iazard 10-01-2007 11:33

[REQ] Fake Team Bot
 
Hi,
Just wondering if somebody could help me add additional coding to this plugin so that when 4 people join server the bots will be removed...
thanks in advance

here is the code:

Code:
#include <amxmodx> #include <fakemeta> #include <cstrike> new botteam[3] static const botnames[3][] = {     "NULL",     "Terrorist Team",           //Change Terrorist Bot Name     "Counter-Terrorist Team"    //Change CT Bot name     } public plugin_init() {     register_plugin("Fake TeamBot", "1.0", "OneEyed")     register_event("HLTV","StartRound","a","1=0","2=0")     createBots() } public StartRound()     set_task(0.5, "PostStartRound", 0) public PostStartRound()     for(new x=1; x<3; x++) {         set_pev(botteam[x], pev_effects, (pev(botteam[x], pev_effects) | 128) ) //set invisible         set_pev(botteam[x], pev_solid, 0)       //Not Solid     } createBots() {     new bot, x     for(x = 1; x<3; x++)     {         //is bot in server already?         bot = find_player("bli", botnames[x] )         if(bot) {             botteam[x] = bot             continue         }                 //bot not in server, create them.         bot = engfunc(EngFunc_CreateFakeClient, botnames[x])         botteam[x] = bot         new ptr[128]         dllfunc(DLLFunc_ClientConnect, bot, botnames[x], "127.0.0.1", ptr )         dllfunc(DLLFunc_ClientPutInServer, bot)         select_model(bot, x)     } } select_model(id,team)     switch(team) {         case 1: cs_set_user_team(id, CS_TEAM_T, CS_T_TERROR)         case 2: cs_set_user_team(id, CS_TEAM_CT, CS_CT_URBAN)     }

Again help greatly appreciated

Wilson [29th ID] 10-02-2007 03:40

Re: [REQ] Fake Team Bot
 
Code:
#DEFINE MIN_PLAYERS 4 public client_putinserver() // Case is wrong on this    if( get_players() > MIN_PLAYERS ) remove_all_bots; public remove_all_bots() {    for( new i; i < sizeof(botteam); i++ ) {       if( is_user_bot(botteam[i] )          engfunc( EngFunc_RemoveEntity, botteam[i] );    } }

BioI-Iazard 10-06-2007 18:32

Re: [REQ] Fake Team Bot
 
so i just add that on to the bottom of the script?

BioI-Iazard 10-09-2007 02:19

Re: [REQ] Fake Team Bot
 
yes no??

Wilson [29th ID] 10-09-2007 03:36

Re: [REQ] Fake Team Bot
 
Jesus man..try it and see???

Yes, that's all you have to do..

BadAim 10-10-2007 16:36

Re: [REQ] Fake Team Bot
 
this plugin is tested? i want this approved! :P we dont lose any player slots and the round never ends, i liiike it. :P

edit: i tried it, i have few errors during the compilation, i dont know if my compiler is right cause i have an old version of ven's fakemeta and a 1.75 compiler. lol

watch if your plugin works, habitually my old compiler works :D

forfun 12-18-2008 12:23

Re: [REQ] Fake Team Bot
 
That is the thing that I really need, but compilation still comes out with one error:
Code:

/home/groups/amxmodx/tmp3/phpAA7sqd.sma(66) : error 001: expected token: ")", but found "-identifier-"
Please can somebody help me with this?...Thanks

SnoW 12-18-2008 12:37

Re: [REQ] Fake Team Bot
 
Post the updated code so we can help some how... Don't add this to the "bottom"
Code:

#DEFINE MIN_PLAYERS 4
You should leave it right after includes...

forfun 12-18-2008 13:10

Re: [REQ] Fake Team Bot
 
well here it is
Code:

// Never do you have to deal with round ending again!
#include <amxmodx>
#include <fakemeta>
#include <cstrike>

#define MIN_PLAYERS 4

new botteam[3]

static const botnames[3][] = {
    "NULL",
    "Terrorist Team",            //Change Terrorist Bot Name
    "Counter-Terrorist Team"    //Change CT Bot name
    }

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

public StartRound()
    set_task(0.5, "PostStartRound", 0)

public PostStartRound()
    for(new x=1; x<3; x++) {
        set_pev(botteam[x], pev_effects, (pev(botteam[x], pev_effects) | 128) ) //set invisible
        set_pev(botteam[x], pev_solid, 0)        //Not Solid
    }

createBots()
{
    new bot, x
    for(x = 1; x<3; x++)
    {
        //is bot in server already?
        bot = find_player("bli", botnames[x] )
        if(bot) {
            botteam[x] = bot
            continue
        }
       
        //bot not in server, create them.
        bot = engfunc(EngFunc_CreateFakeClient, botnames[x])
        botteam[x] = bot
        new ptr[128]
        dllfunc(DLLFunc_ClientConnect, bot, botnames[x], "127.0.0.1", ptr )
        dllfunc(DLLFunc_ClientPutInServer, bot)
        select_model(bot, x)
    }
}

select_model(id,team)
    switch(team) {
        case 1: cs_set_user_team(id, CS_TEAM_T, CS_T_TERROR)
        case 2: cs_set_user_team(id, CS_TEAM_CT, CS_CT_URBAN)
    }

public client_putinserver()
      if( get_playersnum() > MIN_PLAYERS ) remove_all_bots;

public remove_all_bots() {
    for( new i; i < sizeof(botteam); i++ ) {
          if( is_user_bot(botteam[i] )
            engfunc( EngFunc_RemoveEntity, botteam[i] );
      }
}


SnoW 12-18-2008 13:35

Re: [REQ] Fake Team Bot
 
Okay you only copied the code and didn't do the mistake, still you should check the line what the compiler says to u, I mean before posting to get help. It's just what the compiler says...:
Code:

if( is_user_bot(botteam[i] )
->
Code:

if( is_user_bot(botteam[i] ))


All times are GMT -4. The time now is 16:05.

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