Raised This Month: $32 Target: $400
 8% 

How do I get an entity's position?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Darkimmortal
Senior Member
Join Date: Aug 2008
Old 01-25-2009 , 12:16   How do I get an entity's position?
Reply With Quote #1

I need a way of getting the position of entities from FindEntityByClassname - can it be done?

I've already searched the Wiki, API and Forum to no avail.


The plugin is designed for TF2, if that makes a difference.
Darkimmortal is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 01-25-2009 , 12:27   Re: How do I get an entity's position?
Reply With Quote #2

Code:
new Float:position[3];
GetEntPropVector(entity, Prop_Send, "m_vecOrigin", position);
bl4nk is offline
Darkimmortal
Senior Member
Join Date: Aug 2008
Old 01-25-2009 , 12:30   Re: How do I get an entity's position?
Reply With Quote #3

Thanks

+karma
Darkimmortal is offline
Downtown1
Veteran Member
Join Date: Mar 2004
Old 02-16-2009 , 00:42   Re: How do I get an entity's position?
Reply With Quote #4

This definitely should be considered as a utility function like GetEntityVectorOrigin or something.

Because I was a newb and tried to use GetClientAbsOrigin or GetClientEyeOrigin to get the origin of a witch (L4D) and it kept giving me errors saying it wasn't a valid client index!

I mean sure it wasn't a valid client index, I just couldn't figure out a way till CrimsonGT suggested using the m_vecOrigin netprop.

At least TeleportEntity works on Entities .
Downtown1 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 02:12.


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