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

Weapon slot detection


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-07-2010 , 08:09   Weapon slot detection
Reply With Quote #1

Well, like title said... i want to detect the slot of a weapon id... i think that the best way is with offset but, i can't find it the one to detect slot... the only thing that i found it is this: http://wiki.amxmodx.org/CWeaponBox_(CS) * first, 34 offset * but don't know... this is the correct one that i should use it?
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 07-07-2010 , 08:24   Re: Weapon slot detection
Reply With Quote #2

Well, this may be of use to you: https://forums.alliedmods.net/showth...47#post1109747
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-07-2010 , 15:07   Re: Weapon slot detection
Reply With Quote #3

Emm, but as far as i understand in the code of connor he is doing the inverse... he is detecting the weapon that are in the stock that you set... or i am wrong?

I want to detect the number of the slot, giving an id (or name, doesn't matter) of the weapon.

EDIT: Maybe i can use that code using a loop to detect the correct slot, but i will wait a better method =p
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 07-07-2010 , 15:43   Re: Weapon slot detection
Reply With Quote #4

Code:
new const Slots[] = {     0, // NULL     2, // CSW_P228     0, // NULL     1, // CSW_SCOUT     4, // CSW_HEGRENADE     1, // CSW_XM1014     5, // CSW_C4     1, // CSW_MAC10     1, // CSW_AUG     4, // CSW_SMOKEGRENADE     2, // CSW_ELITE     2, // CSW_FIVESEVEN     1, // CSW_UMP45     1, // CSW_SG550     1, // CSW_GALIL     1, // CSW_FAMAS     2, // CSW_USP     2, // CSW_GLOCK     1, // CSW_AWP     1, // CSW_MP5NAVY     1, // CSW_M249     1, // CSW_M3     1, // CSW_M4A1     1, // CSW_TMP     1, // CSW_G3SG1     4, // CSW_FLASHBANG     2, // CSW_DEAGLE     1, // CSW_SG552     1, // CSW_AK47     3, // CSW_KNIFE     1 // CSW_P90 } GetSlotNumber( Wep )     return ( 0 <= Wep < sizeof Slots ) ? Slots[Wep] : 0;
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT

Last edited by wrecked_; 07-07-2010 at 16:00.
wrecked_ is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-07-2010 , 16:02   Re: Weapon slot detection
Reply With Quote #5

What do you want exactly ?

Weapon Slot by weapon entity index ?
- ExecuteHam(Ham_Item_ItemSlot, iWeaponEntity)

By weapon type ?
- Use the lookup table wrecked_ pointed

-> Slots[CSW_SCOUT]

This is not a loop.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-07-2010 , 19:06   Re: Weapon slot detection
Reply With Quote #6

Cool, i think i will use the Ham_Item_ItemSlot, thanks connor and wrecked.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
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 22:49.


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