.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Bot Give Weapons
Old
  (#1)
AltPluzF4
Member
 
Status: Offline
Posts: 1
Join Date: Oct 2005
Default Bot Give Weapons - 08-10-2005

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

Anyway, I need help lol..

This is the code (ripped from hlsdk *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++ :-/

Last edited by AltPluzF4; 08-10-2005 at 06:07.. Reason: forgot CODE tags :p
  
Reply With Quote
Re: Bot Give Weapons
Old
  (#2)
cld
Member
 
Status: Offline
Posts: 3
Join Date: Oct 2005
Default Re: Bot Give Weapons - 14-10-2005

see other bot sources ... hpb bot, joebot, etc.
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com