Raised This Month: $ Target: $400
 0% 

Get secondary weapon?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-10-2018 , 10:16   Re: Get secondary weapon?
Reply With Quote #1

Or the better way:
PHP Code:
new const m_rgpPlayerItems_CBasePlayer[6] = {367,368,...}
new 
WeaponEnt get_pdata_cbase(idm_rgpPlayerItems_CBasePlayer[2])
new 
WeaponIndex cs_get_weapon_id(WeaponEnt
If he has multiple pistols then to get the others retrieve their index from m_pNext offset(get_pdata_cbase(WeaponEnt, m_pNext, 4)).
__________________

Last edited by HamletEagle; 07-10-2018 at 10:17.
HamletEagle is offline
sekac
Senior Member
Join Date: Nov 2016
Old 07-10-2018 , 10:29   Re: Get secondary weapon?
Reply With Quote #2

Quote:
Originally Posted by HamletEagle View Post
Or the better way:
PHP Code:
new const m_rgpPlayerItems_CBasePlayer[6] = {367,368,...}
new 
WeaponEnt get_pdata_cbase(idm_rgpPlayerItems_CBasePlayer[2])
new 
WeaponIndex cs_get_weapon_id(WeaponEnt
If he has multiple pistols then to get the others retrieve their index from m_pNext offset(get_pdata_cbase(WeaponEnt, m_pNext, 4)).

Thank you. Is there a way to directly get the weapon name from WeaponEnt or is get_weaponname necessary?
sekac is offline
Reply



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


All times are GMT -4. The time now is 12:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode