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

how to use this native ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 04-14-2014 , 05:08   how to use this native ?
Reply With Quote #1

Hello !

how to use set_pdata_int ?

i find this link but i need more detail ,

example

1. "what is an offset ?"
2. "Where i can find a list with offsets ?"
3. "How to use this function?"
4. "Some Notice ? Some Observation ? Some Example ?"

Thank you!

Last edited by swapped; 04-14-2014 at 05:09.
swapped is offline
proffs
Senior Member
Join Date: Jul 2013
Old 04-14-2014 , 05:51   Re: how to use this native ?
Reply With Quote #2

Quote:
index is the numerical entity index.
offset is the numerical offset into the memory block, as an C-type integer.
value is the value to set.
proffs is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-14-2014 , 16:09   Re: how to use this native ?
Reply With Quote #3

Simply look for plugins or code snippets that use it. It's much easier to have an idea of what you are doing and search for that instead of trying to "learn what a generic native does".
__________________
fysiks is offline
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 04-15-2014 , 01:49   Re: how to use this native ?
Reply With Quote #4

proffs @ Like i say in my first post i see this link but is no help my to much ( like your reply )

fiskis @ I will try, but you can tell me just how to find a list with all offsets ?
swapped is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 04-16-2014 , 08:52   Re: how to use this native ?
Reply With Quote #5

Quote:
Originally Posted by claudiuhks View Post
http://en.wikipedia.org/wiki/C_data_types

Well, it's like how you understand it. I don't think it's a big deal. All you need to know is that a normal integer may use values equal to 2,147,483,647.
I also started a thread for help on C-Type integer and claudiuhks told me this....
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 04-16-2014 , 09:02   Re: how to use this native ?
Reply With Quote #6

Quote:
Originally Posted by ezio_auditore View Post
I also started a thread for help on C-Type integer and claudiuhks told me this....


This should be the answer for my first questions ?

about the most importanted ? (second questions)
swapped is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 04-16-2014 , 09:07   Re: how to use this native ?
Reply With Quote #7

https://forums.alliedmods.net/showth...=set_pdata_int
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 04-16-2014 , 10:42   Re: how to use this native ?
Reply With Quote #8

Quote:
Originally Posted by YamiKaitou View Post
this should answer me on my four questions , thank you !
swapped is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-16-2014 , 12:32   Re: how to use this native ?
Reply With Quote #9

long story short:

In C, you have class like :

Code:
CBasePlayer
{

};
And inside, you have members, which are basically data associated to class, like :

Code:
CBasePlayer
{
      int m_iSomething;
      float m_flNextSomething;
      bool m_fIsSomething;
     ...
};
Here a CBasePlayer object represents basically a player.

It would be interesting and useful to retrieve what values hold such private members of a player.
It's possible to do this with "pdata" natives.

We are talking about offsets, because you have to imagine CBasePlayer like a big array.
An offset is basically the same as an index. It gives you the position from a start position.
E.g. Let's say we start from 0, m_fIsSomething will have as position: start position + 2.
2 is actually the offset.

Of course an offset value depends of it's data type size too (integer (4), char (1), etc.), but here it's just to explain fastly.

So, to get value of m_flNextSomething, you would use : get_pdata_float(player_id, 1);

You can find some known offsets here: https://forums.alliedmods.net/showpo...&postcount=134
__________________
Arkshine is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-16-2014 , 16:12   Re: how to use this native ?
Reply With Quote #10

The offset doesn't appear to depend on any data type sizes since offsets are sequential. The only place it appears that you have to take into account the data type is the version of get_pdata_*() you use.

Correct me if I'm wrong Arkshine.
__________________

Last edited by fysiks; 04-16-2014 at 16:15.
fysiks 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 06:00.


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