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

Getting an entity's id


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 04-04-2012 , 05:58   Getting an entity's id
Reply With Quote #1

Hey guys.

What function tells me the entity id of the weapon a player is holding right now?
I searched but found nothing, only found get_user_weapon which returns the CSW_ type it is, I need entity id.

EDIT: Nevermind sorry for posting, I needed it for cur weapon and I forgot I can read_data(2)

Edit2: oops read_data(2) there is CSW_ aswell, how can I get the entity then?
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive

Last edited by Diegorkable; 04-04-2012 at 06:34.
Diegorkable is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-04-2012 , 06:48   Re: Getting an entity's id
Reply With Quote #2

To get the active weapon you can use m_pActiveItem offset (373) with get_pdata_cbase. But the question is what you want really to do, because you could hook forward where the entity is passed ?
__________________

Last edited by Arkshine; 04-04-2012 at 06:49.
Arkshine is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 04-04-2012 , 08:26   Re: Getting an entity's id
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
To get the active weapon you can use m_pActiveItem offset (373) with get_pdata_cbase. But the question is what you want really to do, because you could hook forward where the entity is passed ?
I use CurWeapon and I can't really change cuz I have a big code on it (I don't have the nerves to), I think I don't mind get_pdata_cbase.

NOTE: I have Linux so the offset for me is 378
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive

Last edited by Diegorkable; 04-04-2012 at 08:40.
Diegorkable is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-04-2012 , 09:34   Re: Getting an entity's id
Reply With Quote #4

Quote:
Originally Posted by Diegorkable View Post
NOTE: I have Linux so the offset for me is 378
Doesn't matter. You still pass 373. The linux offset for players is 5, so 373 + 5 = 378.
When you use the function, the linux offset will be added automatically if it is a linux server.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 04-04-2012 , 10:31   Re: Getting an entity's id
Reply With Quote #5

Quote:
Originally Posted by Exolent[jNr] View Post
Doesn't matter. You still pass 373. The linux offset for players is 5, so 373 + 5 = 378.
When you use the function, the linux offset will be added automatically if it is a linux server.
oh =\
Well thanks for clearing that out for me
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable 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 15:13.


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