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

[183] gamedata


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 04-25-2017 , 04:47   [183] gamedata
Reply With Quote #1

I am trying out the new gamedata things
Code:
new GameConfig:file = Invalid_GameConfig, iObserverTarget = 447
file = LoadGameConfigFile("common.games/entities.games/cstrike/offsets-cbaseplayer")
log_amx("#%d m_hObserverTarget <%d> <%d>", file, iObserverTarget, GameConfGetOffset(file, "m_hObserverTarget"))
CloseGameConfigFile(file)
and i get this.
Code:
#1 m_hObserverTarget <447> <-1>
^why it is throwing me a failure? all seems ok O.o

EDIT:

with:
Code:
new GameConfig:file = Invalid_GameConfig, iObserverTarget = 447
file = LoadGameConfigFile("common.games/entities.games/cstrike/offsets-cbaseplayer")
m_hObserverTarget = GameConfGetClassOffset(file, "CBasePlayer", "m_hObserverTarget")
log_amx("#%d m_hObserverTarget <%d> <%d>", file, iObserverTarget, m_hObserverTarget)
CloseGameConfigFile(file)
I get:
Code:
#1 m_hObserverTarget <447> <392>
anything seems good, but "semiclip_render_free_look" dosent work anymore


meta list
Spoiler

meta version
Spoiler

amxx modules
Spoiler

amxx plugins
Spoiler

version
Spoiler

status
Spoiler
__________________

Working on:
nothing

Last edited by schmurgel1983; 04-25-2017 at 05:27. Reason: edit 3
schmurgel1983 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 04-25-2017 , 06:45   Re: [183] gamedata
Reply With Quote #2

What exactly are you trying to do? If you just want to get pdata using offsets, you can use new ent_data natives that actually use the gameconfig parser.
PHP Code:
new const observerTarget get_ent_data_entity(entity"CBasePlayer""m_hObserverTarget"); 
klippy is offline
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 04-25-2017 , 07:13   Re: [183] gamedata
Reply With Quote #3

Quote:
Originally Posted by KliPPy View Post
What exactly are you trying to do? If you just want to get pdata using offsets, you can use new ent_data natives that actually use the gameconfig parser.
PHP Code:
new const observerTarget get_ent_data_entity(entity"CBasePlayer""m_hObserverTarget"); 
Thanks, I was trying this
Code:
stock fm_cs_get_free_look_target(id)
{
	if (pev_valid(id) != pdata_safe)
		return 0
	
	static ObserverTarget = -1
	if (ObserverTarget == -1)
	{
		new iObserverTarget = 447
		ObserverTarget = get_ent_data_entity(id, "CBasePlayer", "m_hObserverTarget")
		log_amx("m_hObserverTarget <%d> <%d>", iObserverTarget, ObserverTarget)
	}
	return (ObserverTarget != -1) ? get_pdata_int(id, ObserverTarget, linux_diff, mac_diff) : 0
}
Code:
#1 m_hObserverTarget <447> <-1>
__________________

Working on:
nothing

Last edited by schmurgel1983; 04-25-2017 at 07:17. Reason: added wrong code :D
schmurgel1983 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 04-25-2017 , 07:57   Re: [183] gamedata
Reply With Quote #4

get_ent_data_entity() doesn't get the offset, it gets the data just as get_pdata_int() does. Read the documentation.
klippy is offline
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 04-25-2017 , 08:54   Re: [183] gamedata
Reply With Quote #5

Quote:
Originally Posted by KliPPy View Post
get_ent_data_entity() doesn't get the offset, it gets the data just as get_pdata_int() does. Read the documentation.
So i dont need this, thanks for your help.



Anyone else can help?
__________________

Working on:
nothing
schmurgel1983 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 04-25-2017 , 09:16   Re: [183] gamedata
Reply With Quote #6

I actually think you do. But you should first thoroughly explain what you really want.
If you want to get the client a player is observing, you can just retrieve pev_iuser2.

Last edited by klippy; 04-25-2017 at 09:18.
klippy is offline
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 04-25-2017 , 09:23   Re: [183] gamedata
Reply With Quote #7

Quote:
Originally Posted by schmurgel1983 View Post
anything seems good, but "semiclip_render_free_look" dosent work anymore
__________________

Working on:
nothing
schmurgel1983 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 04-25-2017 , 10:36   Re: [183] gamedata
Reply With Quote #8

What's that, a plugin? That alone doesn't mean much to me.
klippy 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 22:50.


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