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

[Metamod] Get Private Data Index


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DavidJr
Senior Member
Join Date: Apr 2012
Old 05-09-2015 , 10:30   [Metamod] Get Private Data Index
Reply With Quote #1

I tried this but gets the wrong result, how to get it correct?

PHP Code:
int iEnt NULL;
iEnt = *((int *)pEnt->pvPrivateData 367 2); //rgpPlayerItemsSlot0 + 2

Util.Print_Console(pEnt"Error %d\n"iEnt); 
__________________
What are you looking for here?
DavidJr is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 05-10-2015 , 08:36   Re: [Metamod] Get Private Data Index
Reply With Quote #2

Quote:
Originally Posted by DavidJr View Post
I tried this but gets the wrong result, how to get it correct?

PHP Code:
int iEnt NULL;
iEnt = *((int *)pEnt->pvPrivateData 367 2); //rgpPlayerItemsSlot0 + 2

Util.Print_Console(pEnt"Error %d\n"iEnt); 
To get INT value.

PHP Code:
int Value 0;

#if !defined(__linux__)
  
Value = *((int *)pEntity->pvPrivateData OFFSET_ID);
#else
  
Value = *((int *)pEntity->pvPrivateData OFFSET_ID OFFSET_LINUX);
#endif 
Sometimes, OFFSET_ID can be a mix like (OFFSET_SOMETHING + OFFSET_SOMETHING_ELSE) and OFFSET_LINUX can be 4 (for Weapon edicts on Linux).
Have you browsed CStrike?
__________________

Last edited by claudiuhks; 05-10-2015 at 08:41.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
DavidJr
Senior Member
Join Date: Apr 2012
Old 05-10-2015 , 09:00   Re: [Metamod] Get Private Data Index
Reply With Quote #3

Quote:
Originally Posted by claudiuhks View Post
To get INT value.

PHP Code:
int Value 0;

#if !defined(__linux__)
  
Value = *((int *)pEntity->pvPrivateData OFFSET_ID);
#else
  
Value = *((int *)pEntity->pvPrivateData OFFSET_ID OFFSET_LINUX);
#endif 
Sometimes, OFFSET_ID can be a mix like (OFFSET_SOMETHING + OFFSET_SOMETHING_ELSE) and OFFSET_LINUX can be 4 (for Weapon edicts on Linux).
Have you browsed CStrike?
I want to retrieve what weapons I have in slot1/2/3/4/5, what data value does m_rgpPlayerItemsSlot return? I try to convert this AMX to C++. I did not see the cstrike, but I did see how get_pdata_cbase and get_pdata_int work in hamsandwich and fakemeta, however, the result sometimes makes the CS crash, sometimes it returns invalid integer. And as long as I know there's no offset changes for Windows

AMXX
PHP Code:
Get_WeaponSlot(iIndexiSlot, &iEnt
{
    if (!( 
<= iSlot <= 5)) return 0;
    
    
iEnt 0;
    
    
iEnt get_pdata_cbase(iIndex m_rgpPlayerItems_Slot0 iSlotXTRA_OFS_WEAPON);
    
    return (
iEnt 0) ? get_pdata_int(iEnt m_iIdXTRA_OFS_WEAPON) : 0;

C++ (So far I've tried)
PHP Code:
edict_t *pItem;
pItem ENT(pPlayer->.pvPrivateData m_rpgPlayerItemsSlot0 2); // Get slot 2, 367 + 2

 
Util.Print_Console(pEnt"Class %s\n"pItem->v.classname); // returns (null)

int iWpn = *((int *)pItem->pvPrivateData m_iId)); // offset 43

Util.Print_Console(pEnt"Wpn ID %d\n"iWpn); // this is crashed 
PHP Code:
int iItem = *((int *)pEntity->pvPrivateData m_rpgPlayerItemsSlot0 2));

Util.Print_Console(pEnt"Index %d\n"iItem); // returns numbers as thousands 
I use Windows btw.
__________________
What are you looking for here?

Last edited by DavidJr; 05-10-2015 at 09:06.
DavidJr is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 05-10-2015 , 12:16   Re: [Metamod] Get Private Data Index
Reply With Quote #4

GetPDataCBase is different. You need more code.
__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
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 19:41.


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