.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   bot donīt spawn (http://forums.bots-united.com/showthread.php?t=542)

cctnt 26-04-2004 21:02

Re: bot donīt spawn
 
sry for bringing this old topic up again but i canīt get a rid of this bug

it now spawns in free fight but it doesnīt in team mod
maybe i when i post my botstart for my dll someone could help me

Code:

if (mod_id == NWN_DLL)
{
        if ((pBot->start_action == MSG_TFC_IDLE) &&
                (pBot->create_time + 3.0 <= gpGlobals->time))
        {
                pBot->start_action = MSG_TFC_TEAM_SELECT; // force team selection
        }
        // handle Team Fortress Classic stuff here...
        if (pBot->start_action == MSG_TFC_TEAM_SELECT)
        {
                pBot->start_action = MSG_TFC_IDLE; // switch back to idle
                pBot->create_time = gpGlobals->time; // reset
                if ((pBot->bot_team != 1) && (pBot->bot_team != 2))
                        pBot->bot_team = -1;
                if (pBot->bot_team == -1)
 
for(index=1;index<=gpGlobals->maxClients;index++)
{
        pPlayer = INDEXENT(index);
}
 
                retry_count = 0;
 
                // select the team the bot wishes to join...
                if (pBot->bot_team == 1)
                        strcpy(c_team, "1");
                else if (pBot->bot_team == 2)
                        strcpy(c_team, "2");
                else
                        strcpy(c_team, "5");
                FakeClientCommand(pEdict, "jointeam", c_team, NULL);
                pBot->start_action = MSG_TFC_CLASS_SELECT;
                return;
        }
        if (pBot->start_action == MSG_TFC_CLASS_SELECT)
        { char *cvar_gamemode = (char *)CVAR_GET_STRING("mp_gamemode");
                pBot->start_action = MSG_TFC_IDLE; // switch back to idle
                pBot->create_time = gpGlobals->time; // reset
                if ((pBot->bot_class < 0) || (pBot->bot_class > 8))
                        pBot->bot_class = -1;
                if (pBot->bot_class == -1)
                        pBot->bot_class = RANDOM_LONG(0, 7);
                team = UTIL_GetTeam(pEdict);
if ((cvar_gamemode && cvar_gamemode[0]) && (strncmp(cvar_gamemode, "1", 1) == 0))
                {
if (pBot->bot_team == 1)
        {
        if ((pBot->bot_class != 0)&&(pBot->bot_class != 1) && (pBot->bot_class != 2) && (pBot->bot_class != 3) )
        {
        if (RANDOM_LONG(1, 2) < 2)
        pBot->bot_class = RANDOM_LONG(0, 3);
        else
        pBot->bot_class = RANDOM_LONG(4, 7);
        }
        }
        else
        {
        if ((pBot->bot_class != 4) && (pBot->bot_class != 5) && (pBot->bot_class != 6) && (pBot->bot_class != 7) )       
        {
        int i = RANDOM_LONG(1, 3);
                                        switch (i)
        {
        case 1:
                pBot->bot_class = 0;
        break;
        case 2:
        pBot->bot_class = 3;
        break;
        case 3:
        pBot->bot_class = RANDOM_LONG(4, 7);
        break;
        default:
        break;
        }
        }
        }
}
// select the class the bot wishes to use...
                if (pBot->bot_class == 0)
                        strcpy(c_class, "naruto");
                else if (pBot->bot_class == 1)
                        strcpy(c_class, "sasuke");
                else if (pBot->bot_class == 2)
                        strcpy(c_class, "kakashi");
                else if (pBot->bot_class == 3)
                        strcpy(c_class, "sakura");
                else if (pBot->bot_class == 4)
                        strcpy(c_class, "garaa");
                else if (pBot->bot_class == 5)
                        strcpy(c_class, "orichimaru");
                else if (pBot->bot_class == 6)
                        strcpy(c_class, "kankaru");
                else if (pBot->bot_class == 7)
                        strcpy(c_class, "temari");
else
        strcpy(c_class, "randompc");
                FakeClientCommand(pEdict, c_class, NULL, NULL);
                // bot has now joined the game (doesn't need to be started)
                pBot->not_started = 0;
                return;
        }
}
else
{
        // otherwise, don't need to do anything to start game...
        pBot->not_started = 0;
}

someone that may help me?


All times are GMT +2. The time now is 20:26.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.