AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Finding entity's owner? (https://forums.alliedmods.net/showthread.php?t=22500)

Des12 12-28-2005 16:30

Finding entity's owner?
 
I know you can do

Code:
entity_set_edict(entity, EV_ENT_owner, id)
to set an entity's owner, but how do you find an entity's owner?

teame06 12-28-2005 16:32

http://www.amxmodx.org/funcwiki.php?...edic&go=search


http://www.amxmodx.org/funcwiki.php ... This should be your best friend.

[+] 12-28-2005 17:35

Correction..this should be your best friend - http://www.amxmodx.org/forums/search.php :D

v3x 12-28-2005 18:20

Quote:

Originally Posted by [+
]Correction..this should be your best friend - http://www.amxmodx.org/forums/search.php :D

:stupid:

teame06 12-28-2005 18:39

Quote:

Originally Posted by [+
]Correction..this should be your best friend - http://www.amxmodx.org/forums/search.php :D

They both should be :twisted:

Jordan 12-28-2005 19:19

But you can't have two BEST friends... looks like we have some conflict here :twisted:

[+] 12-28-2005 19:20

Ha, I believe we do. Yet, the search link can guide you to the funcwiki. So, I believe the search link wins!

Xanimos 12-28-2005 20:57

But wait there is another friend that you all so politely forgot.
http://www.amxmodx.org/doc/
He is a good friend to.

Des12 12-28-2005 23:12

I tried the function library before I posted :/

And I searched "entity owner" on the search, and only thing I found might be something like

Code:
new ent, entbody get_user_aiming(id, ent, entbody, 200) targetid = find_ent_by_name(ent, //code to find the owner)

Kind of threw that together in 5 seconds, but I thinks its a start.

See my problem is I am trying to get a targetid, but an entitiy surronds and is parented to the targetid

So player1 looks at player2, and it tries to kill him, but it does nothing since an entitiy in the way

If I got the owner of the entitiy (player2) then I could take a detour and kill player2 instead.

Charr 12-29-2005 13:03

Code:
new ownerid = entity_get_edict(entity, EV_ENT_owner)


All times are GMT -4. The time now is 16:11.

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