Raised This Month: $51 Target: $400
 12% 

Get slot weapon CSW ID


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 11-14-2014 , 05:23   Get slot weapon CSW ID
Reply With Quote #1

Hi, how to get selected weapon CSW id on pressed slot? Or how to hook pressed slots cmds?
FromTheFuture is offline
Bladell
Senior Member
Join Date: Jun 2012
Old 11-15-2014 , 06:35   Re: Get slot weapon CSW ID
Reply With Quote #2

Maybe this can help you https://forums.alliedmods.net/showthread.php?t=182970
Bladell is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-15-2014 , 07:17   Re: Get slot weapon CSW ID
Reply With Quote #3

@Bladell, the method from the topic you linked used for detecting if a player has primary weapons is somehow inneficient:
Code:
//You would need hamsandwich module stock const m_rgpPlayerItems_CBasePlayer[ 6 ] = { 367 , 368 , ... } const XO_PLAYER = 5 #define HasPrimaryWeapon(%0)   ( get_pdata_cbase(%0,  m_rgpPlayerItems_CBasePlayer[ 1 ], XO_PLAYER ) )

Then, just do HasPrimaryWeapon(index). I don't understood what you need, but if you want to get the weapon slot use Ham_ItemSlot.
__________________

Last edited by HamletEagle; 11-15-2014 at 07:18.
HamletEagle is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 11-15-2014 , 11:53   Re: Get slot weapon CSW ID
Reply With Quote #4

Quote:
Originally Posted by HamletEagle View Post
@Bladell, the method from the topic you linked used for detecting if a player has primary weapons is somehow inneficient:
Code:
//You would need hamsandwich module stock const m_rgpPlayerItems_CBasePlayer[ 6 ] = { 367 , 368 , ... } const XO_PLAYER = 5 #define HasPrimaryWeapon(%0)   ( get_pdata_cbase(%0,  m_rgpPlayerItems_CBasePlayer[ 1 ], XO_PLAYER ) )

Then, just do HasPrimaryWeapon(index). I don't understood what you need, but if you want to get the weapon slot use Ham_ItemSlot.
Ow, U can show me an example with Ham_ItemSlot?
FromTheFuture 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 09:40.


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