Raised This Month: $32 Target: $400
 8% 

Solved How do I use GameConfGet(Class)Offset?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 03-24-2019 , 09:18   How do I use GameConfGet(Class)Offset?
Reply With Quote #1

I'm trying to get the needed offsets without hardcoding them.

In specific, getting the owner of a weapon in Ham_Item_Deploy.
That would be m_pPlayer, or 41.

I tried to find it in the gamedata files, there is one "m_pPlayer" in "common.games/entities.games/cstrike/offsets-cbaseplayeritem.txt",
but it has a value of 180 ??????

PHP Code:
new id get_pdata_cbase(entGameConfGetClassOffset(gameConfig"CBasePlayerItem""m_pPlayer"),4
That, of course, crashes the server and I can't really find "41" in there.

How exactly am I supposed to use these gamedata offsets to retrieve the correct value in a plugin?
Or hardcoding them is fine? ugh.........
__________________

Last edited by <VeCo>; 03-24-2019 at 09:37.
<VeCo> is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-24-2019 , 09:26   Re: How do I use GameConfGet(Class)Offset?
Reply With Quote #2

In gamedata files you will find full offsets, what you usually used before were converted so you can use them with the old pdata natives.
You can do the conversion manually to see that it is in fact the same offset. Get the window value(not linux), which is 164. Since it's a weapon offset you are going to divide by 4 => 164 / 4 = 41

I'm not sure what native you are going to use to retrieve the offset from the gamedata tho, never tried it.
__________________

Last edited by HamletEagle; 03-24-2019 at 09:27.
HamletEagle is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 03-24-2019 , 09:28   Re: How do I use GameConfGet(Class)Offset?
Reply With Quote #3

Code:
get_ent_data_entity(weapon, "CBasePlayerItem", "m_pPlayer");
__________________








CrazY. is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 03-24-2019 , 09:37   Re: How do I use GameConfGet(Class)Offset?
Reply With Quote #4

oooh, I see... how did I miss that
thank you guys
__________________
<VeCo> 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 21:31.


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