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

Solved [CS] How to find the correct offset?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
E1_531G
Senior Member
Join Date: Dec 2017
Old 10-07-2018 , 08:07   [CS] How to find the correct offset?
Reply With Quote #1

Hello.

I have a question about offsets.

In this code:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

#define m_iDefaultItems  120

public plugin_init()
    
RegisterHamHam_Spawn"player""ham_PlayerSpawn_Pre" );

public 
ham_PlayerSpawn_Preid )
    
set_pdata_intidm_iDefaultItems); 
We have offset 120, but this is int version, it must be bool, we can see it here: https://forums.alliedmods.net/showthread.php?t=217673
PHP Code:
const m_bHasReceivedDefItems 480
And, problems begin here.

An offset named "m_bHasReceivedDefItems" doesn't exist.
If we look in gamedata, offset 480 is "m_bJustConnected" (cbaseplayer).
Offset 120 is "m_flStartThrow" (cbaseentity).
So, it is clearly not what we need.

Also, if we try to convert int to bool (i saw it somewhere on forum), 120 * 4 + (4 * 5) = 500, but offset 500 is "m_bMissionBriefing" (cbaseplayer), so, it's wrong again.

My question is very simple: how to find the correct offset?

Thank you all.
__________________
My English is A0

Last edited by E1_531G; 10-08-2018 at 17:40.
E1_531G is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 10-07-2018 , 10:08   Re: [CS] How to find the correct offset?
Reply With Quote #2

m_bJustConnected is what you need
You didnt think about different name but same offset?
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 10-07-2018 at 10:10.
Ghosted is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 10-07-2018 , 10:55   Re: [CS] How to find the correct offset?
Reply With Quote #3

Quote:
Originally Posted by Ghosted View Post
m_bJustConnected is what you need
You didnt think about different name but same offset?
No, i don't think so.
Make sure you look at this plugin: https://forums.alliedmods.net/showthread.php?t=217673
__________________
My English is A0
E1_531G is offline
Old 10-07-2018, 11:39
thEsp
This message has been deleted by thEsp.
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 10-08-2018 , 15:24   Re: [CS] How to find the correct offset?
Reply With Quote #4

https://wiki.alliedmods.net/Category:CS_Class_List
__________________








CrazY. is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 10-08-2018 , 16:19   Re: [CS] How to find the correct offset?
Reply With Quote #5

Quote:
Originally Posted by CrazY. View Post
Yeah, i know, but that list is old. I speak about new gamedata (AMXX 190).

@HamletEagle, @Bugsy, @Arkshine, anyone??
__________________
My English is A0
E1_531G is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-08-2018 , 16:23   Re: [CS] How to find the correct offset?
Reply With Quote #6

The offset is probably m_bJustConnected. Because for this case you do 120 * 4 = 480. Also seeing how it is used:
https://github.com/s1lentq/ReGameDLL...ules.cpp#L3633

If it's true OnSpawnEquip will not be called(https://github.com/s1lentq/ReGameDLL...ayer.cpp#L9339), then GiveDefaultItems will not be called: https://github.com/s1lentq/ReGameDLL...ayer.cpp#L9356.
__________________
HamletEagle is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 10-08-2018 , 17:39   Re: [CS] How to find the correct offset?
Reply With Quote #7

Oh, yeah, this make sense. Thank you.

@Ghosted, you was right, thank you too.

Also, looking at this code i noticed that i can change only m_bNotKilled.
If it is true the player won't receive default items.

I think it's solved.
__________________
My English is A0
E1_531G 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 10:06.


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