Raised This Month: $ Target: $400
 0% 

Checking Primary/Secondary Weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-05-2010 , 09:02   Re: Checking Primary/Secondary Weapons
Reply With Quote #1

The function returns the slot # for the weapon he is currently holding.

Examples:
1. User holding AWP (or any primary weapon), Get_User_Weapon_ItemSlot( id ) returns 1
2. User holding Glock (or any pistol), Get_User_Weapon_ItemSlot( id ) returns 2
3. User holding Knife, Get_User_Weapon_ItemSlot( id ) returns 3
4. User holding Nade, Get_User_Weapon_ItemSlot( id ) returns 4
PHP Code:
#define XTRA_OFS_PLAYER    5
#define m_pActiveItem    373

Get_User_Weapon_ItemSlot(id)
{
    new 
iActiveItem get_pdata_cbase(idm_pActiveItemXTRA_OFS_PLAYER)
    
    return ( ( 
iActiveItem ) ? ExecuteHam(Ham_Item_ItemSlotiActiveItem) : );

__________________
Bugsy is offline
cs1.7
Senior Member
Join Date: Oct 2008
Old 04-05-2010 , 09:23   Re: Checking Primary/Secondary Weapons
Reply With Quote #2

wow thanks!

and it works now!


edit:


do you maybe know a better way to realize pistol autofire?
__________________
_____________
/_____\
[° ||| °]
./..............\▓

Last edited by cs1.7; 04-05-2010 at 10:21.
cs1.7 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 01:37.


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