Raised This Month: $ Target: $400
 0% 

[TFC] Teleporter arrows


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-17-2015 , 05:42   Re: [TFC] Teleporter arrows
Reply With Quote #2

Quote:
Difficulty with AMXX is that it doesn't give access to certain private entity data of buildings, such as owner of a teleporter and whether it's entrance or exit.
You can access player's private data with fakemeta module and get/set_pdata_*. Just a matter to find the right offset you need.

Well I can help you a bit.

Looking at IDA, when you create a teleporter, it uses real_owner from CBaseEntity to store the player who is building the teleporter, and m_iType from CTFTeleporter to specify entry/exit, and it seems to be 4 for entry and 5 for exit.

Here a dump from linux binary:

CTFTeleporter

CBaseEntity


To use these char-based offsets, you need to calculate first the value windows-based.

Generally, for classes derived from CBaseMonster, it's +20 for linux, otherwise +16.

Here CTFTeleporter, should be +20 and +16 for CBaseEntity.

So:

real_owner = 348 - 16 = 332 ; can be used I think with get_pdata_ent (but this native is int-based, so you need to do 332 / 4). In 1.8.3-dev, you can use 332 with get_pdata_ehandle
m_iType = 1728 - 20 = 1708 ; can be used with get_pdata_int (careful too, this is unfortunately int-based too, so you need to do 708 / 4).

Member with type starting with CBase, like m_pPLayer can be retrieved with get_pdata_cbase (hamsandwich module)

Tell if you don't understand something.
__________________

Last edited by Arkshine; 03-17-2015 at 06:45.
Arkshine is offline
 



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:55.


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