PDA

View Full Version : getting a players current weapon



Cheeseh
02-11-2018, 04:46 PM
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 :p

w00tguy123
02-11-2018, 06:23 PM
CBasePlayerWeapon@ activeWeapon = cast<CBasePlayerWeapon@>(pPlayer.m_hActiveItem.GetEntity());
or if you just want CBaseEntity:

CBaseEntity@ activeWeapon = pPlayer.m_hActiveItem;
No hooks for net messages yet afaik.

Cheeseh
04-11-2018, 03:20 PM
Thanks! sorted! few more questons, I will make a separate thread for each to keep them separate...