AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Accessing EHANDLE member (https://forums.alliedmods.net/showthread.php?t=241802)

teh ORiON 06-09-2014 09:48

Accessing EHANDLE member
 
Hi,

Im in need of retrieving an entity which is stored as an EHANDLE, however it doesn't seem possible to retrieve it with get_pdata_ent() (returns -1) as it doesn't handle the conversion back to CBase, get_pdata_int() returns what seems like a pointer however.

So I need a method for converting an EHANDLE back to a CBaseEntity pointer and then getting the entity index. This is otherwise handled by these functions in CBase:

CBase

Arkshine 06-09-2014 09:54

Re: Accessing EHANDLE member
 
https://github.com/alliedmodders/amx...emeta.inc#L385

teh ORiON 06-09-2014 10:37

Re: Accessing EHANDLE member
 
Ah I see had missed that. It still doesn't work for me however, the EHANDLE is supposed to store a CBasePlayer, I get returned -1 still.

Arkshine 06-09-2014 11:06

Re: Accessing EHANDLE member
 
It works, it has been tested. You probably did not read documentation enough, like offset is byte-based.

teh ORiON 06-09-2014 11:43

Re: Accessing EHANDLE member
 
Ah yes, thanks works, got a bit confused!


All times are GMT -4. The time now is 09:36.

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