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

Missing painshock offset in gamedata?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Netsys
Senior Member
Join Date: Feb 2010
Old 12-26-2015 , 19:18   Missing painshock offset in gamedata?
Reply With Quote #1

I can not find the m_flPainShock ( 108 ) offset in the gamedata, where is it?

Last edited by Netsys; 12-26-2015 at 19:18.
Netsys is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 12-26-2015 , 20:41   Re: Missing painshock offset in gamedata?
Reply With Quote #2

It's probably m_flVelocityModifier. I didn't even know you could use gamedata in plugins, I thought it was just for reference. Can you give an example of how you're using it?
PartialCloning is offline
Netsys
Senior Member
Join Date: Feb 2010
Old 12-26-2015 , 20:57   Re: Missing painshock offset in gamedata?
Reply With Quote #3

Get the hitgroup: get_ent_data(iVictimID, "CBaseMonster", "m_LastHitGroup")
Get user weapon entity: get_ent_data_entity(iMessageEntity, "CBasePlayer", "m_pActiveItem")

Fire rate:

set_ent_data_float(iEntityID, "CBasePlayerWeapon", "m_flNextPrimaryAttack", 0.6);
set_ent_data_float(iEntityID, "CBasePlayerWeapon", "m_flNextSecondaryAttack", 0.6);
set_ent_data_float(iEntityID, "CBasePlayerWeapon", "m_flTimeWeaponIdle", 0.6);
Netsys is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 12-26-2015 , 21:25   Re: Missing painshock offset in gamedata?
Reply With Quote #4

Oh, that's cool, thanks. Did m_flVelocityModifier work? If not try m_flFlinchTime or wait for Arkshine to reply. I couldn't find it either but my guess is it's one of those two.

Edit: Unless he actually forgot to add it, and didn't rename it.

Last edited by PartialCloning; 12-26-2015 at 21:26.
PartialCloning is offline
Netsys
Senior Member
Join Date: Feb 2010
Old 12-26-2015 , 21:38   Re: Missing painshock offset in gamedata?
Reply With Quote #5

I think its m_flVelocityModifier
Netsys is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 12-26-2015 , 21:53   Re: Missing painshock offset in gamedata?
Reply With Quote #6

Yeah that's what I figured but m_flFlinchTime sounded like a name that could have repalced m_flPainShock. Anyway, do you know what this means:
Quote:
"m_pActiveItem" // CBasePlayerItem*
{
"type" "classptr"

"windows" "1492"
"linux" "1512"
"mac" "1512"
}
What's the CBasePlayerItem supposed to mean when it's in CBasePlayer?
PartialCloning is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-27-2015 , 04:35   Re: Missing painshock offset in gamedata?
Reply With Quote #7

All offsets have been dumped from the binary. So, those are the original names. If you don't find it, just search by its value (108*4 to get char-based value).

The comment is the member type. m_pActiveItem is a member of type pointer to CBasePlayerItem class.
Basically an entity index (a player's active item), that you would use before get_pdata_cbase to get its value.

@Netsys, don't forget your other thread.
__________________

Last edited by Arkshine; 12-27-2015 at 04:38.
Arkshine is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 12-27-2015 , 04:36   Re: Missing painshock offset in gamedata?
Reply With Quote #8

It's just a comment for reference. Says that m_pActiveItem is a pointer to a CBasePlayerItem object, which is just any weapon.

EDIT:
Arkshine quicker and more detailed... Oh well.

Last edited by klippy; 12-27-2015 at 04:37.
klippy is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 12-28-2015 , 19:38   Re: Missing painshock offset in gamedata?
Reply With Quote #9

Alright, thanks. But is using the new natives better than using get_pdata..? I know it says safer, but is it slower?
PartialCloning is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 12-29-2015 , 03:41   Re: Missing painshock offset in gamedata?
Reply With Quote #10

Quote:
Originally Posted by PartialCloning View Post
Alright, thanks. But is using the new natives better than using get_pdata..? I know it says safer, but is it slower?
It probably is slower (Arkshine, correct me if I'm wrong), but you probably aren't going to notice any difference. Other than being safer and slower, it's probably easier to deal with. Use new natives if it's not any time-critical code, like forwards that are called per-frame (pfnPreThink, pfnAddToFullPack, etc).

But if you do have to use old natives for performance, looks like you can use them in combination with the following native (just found out this native a few minutes ago):
PHP Code:
native find_ent_data_info(const class[], const member[], &FieldType:type FIELD_NONE, &arraysize 0, &bool:unsigned false); 
This should save you from hardcoding offsets into your plugin.
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 05:16.


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