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

CS:GO Get Entity in a Radius


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yash1441
Senior Member
Join Date: Feb 2015
Location: Illuminati HQ
Old 09-06-2015 , 06:24   CS:GO Get Entity in a Radius
Reply With Quote #1

How can I check for an entity in a radius around a point like the point where a player spawns.
__________________
yash1441 is offline
Send a message via Skype™ to yash1441
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 09-06-2015 , 06:34   Re: CS:GO Get Entity in a Radius
Reply With Quote #2

You need to findentitybyclassname. Some nearby entities may not have origins, or may be patented and the origin is 0 0 0
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 09-06-2015 at 06:35.
friagram is offline
yash1441
Senior Member
Join Date: Feb 2015
Location: Illuminati HQ
Old 09-06-2015 , 11:46   Re: CS:GO Get Entity in a Radius
Reply With Quote #3

Quote:
Originally Posted by friagram View Post
You need to findentitybyclassname. Some nearby entities may not have origins, or may be patented and the origin is 0 0 0
I know how to find the entity, how do I do that only in a radius and not the whole map?
For example, I stored the spawn point of a player in vec[3] and now how can I find an env_fire in a x unit radius around vec?
Also, how can I relate the units used in SourcePawn to that in map? Are they the same as used in maps?
__________________
yash1441 is offline
Send a message via Skype™ to yash1441
Miu
Veteran Member
Join Date: Nov 2013
Old 09-06-2015 , 12:38   Re: CS:GO Get Entity in a Radius
Reply With Quote #4

Quote:
Originally Posted by yash1441 View Post
For example, I stored the spawn point of a player in vec[3] and now how can I find an env_fire in a x unit radius around vec?
PHP Code:
int ent = -1;
float origin[3];

while ((
ent FindEntityByClassname(ent"env_fire")) != -1)
{
    
GetEntPropVector(entProp_Data"m_vecOrigin"origin);
    
    if (
GetVectorDistance(vecorigin) < 300)
    {
        
// found
    
}

Quote:
Originally Posted by yash1441 View Post
Also, how can I relate the units used in SourcePawn to that in map? Are they the same as used in maps?
yes
Miu is offline
Reply


Thread Tools
Display Modes

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 18:50.


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