.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   Bot Give Weapons (http://forums.bots-united.com/showthread.php?t=4559)

AltPluzF4 08-10-2005 05:05

Bot Give Weapons
 
Eh.... well, I was screwing around with metamod... thought about 'giving' weapons...

Anyway, I need help lol..

This is the code (ripped from hlsdk :D *i r newb*)

Code:

void GiveNamedItem(edict_t *pEdict, const char *pszName)
{
    if(strncmp(pszName,"tf_weapon_",10)==0)
    {
        edict_t *pent;
        int istr=MAKE_STRING(pszName);
        pent=CREATE_NAMED_ENTITY(istr);
        if(FNullEnt(pent))
        {
            ALERT(at_console, "NULL Ent in GiveNamedItem!\n");
            return;
        }
        VARS(pent)->origin=VARS(pEdict)->origin;
        pent->v.spawnflags |=SF_NORESPAWN;
        gpGamedllFuncs->dllapi_table->pfnSpawn(pent);
        gpGamedllFuncs->dllapi_table->pfnTouch(pent, pEdict);
    }
}

Anyway, it GIVES the weapon... I see the pickup hud item, and it's in my inventory, but I can't select it. If I have crowbar out, and I press '5' to select rpg, then it acts like it's selecting the RPG, but instead it reselect the crowbar... :-/

Any ideas?
Thanks for any help. I suck at C++ :-/

cld 14-10-2005 05:56

Re: Bot Give Weapons
 
see other bot sources ... hpb bot, joebot, etc.


All times are GMT +2. The time now is 16:14.

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