Thread: getting a players current weapon

Results 1 to 3 of 3
  1. #1
    SvenCoop Bot AI Developer Cheeseh's Avatar
    Join Date
    Sep 2003
    Location
    holy crap!
    Posts
    209

    getting a players current weapon

    Is there any way to get a player's current weapon (either classname, or CBasePlayerWeapon , or CBAseEntity) ?

    Used to be able to read a network message "CurWeapon" . Don't think there's a way to hook net messages either yet?

    Cheers
    - Cheeseh :P

    Get SvenCoop's little helpers!

    http://rcbot.bots-united.com RCBot

    http://rcbot2.sourceforge.net RCBot 2 files + sources

  2. #2
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,598

    Re: getting a players current weapon

    Code:
    CBasePlayerWeapon@ activeWeapon = cast<CBasePlayerWeapon@>(pPlayer.m_hActiveItem.GetEntity());
    or if you just want CBaseEntity:
    Code:
    CBaseEntity@ activeWeapon = pPlayer.m_hActiveItem;
    No hooks for net messages yet afaik.
    Love,
    w00tguy

  3. #3
    SvenCoop Bot AI Developer Cheeseh's Avatar
    Join Date
    Sep 2003
    Location
    holy crap!
    Posts
    209

    Re: getting a players current weapon

    Thanks! sorted! few more questons, I will make a separate thread for each to keep them separate...
    - Cheeseh :P

    Get SvenCoop's little helpers!

    http://rcbot.bots-united.com RCBot

    http://rcbot2.sourceforge.net RCBot 2 files + sources

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •