Raised This Month: $51 Target: $400
 12% 

find_ent_in_sphere


Post New Thread Reply   
 
Thread Tools Display Modes
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-13-2021 , 13:34   Re: find_ent_in_sphere
Reply With Quote #11

I assume you want to detect enemies in a radius around the player. This is as simple as it gets:

Code:
new iPlayers[32], iPnum = find_sphere_class(id, "player", 500.0, iPlayers, sizeof(iPlayers)) for(new CsTeams:iTeam = cs_get_user_team(id), iPlayer, i; i < iPnum; i++) {     iPlayer = iPlayers[i]     if(is_user_alive(id) && cs_get_user_team(iPlayer) != iTeam)     {         // detected an enemy in radius 500     } }
__________________

Last edited by OciXCrom; 03-13-2021 at 13:35.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-13-2021 , 14:27   Re: find_ent_in_sphere
Reply With Quote #12

Quote:
Originally Posted by nacho312 View Post
That's exactly the thing that confuses me, what does "start from" mean? Does it mean that we are searching for it?
"find" and "search" basically have the same meaning. See Natsheh's post.

Quote:
Originally Posted by nacho312 View Post
Ah, that makes sense, so for example, when we set "-1", we can set a "ct player" as an origin and search around him for a "Terrorist" player?
Hamlet's post is wrong and as jimaway stated, it sounds like he's talking about an entirely different function.



In summary, you should always explain what you are actually trying to do when you ask a scripting question so that we can actually understand what you are trying to achieve in your plugin. Often, when you don't include this, you will get answers that don't actually help you do what you are trying to do.
__________________
fysiks is offline
nacho312
Member
Join Date: Mar 2020
Old 03-13-2021 , 15:13   Re: find_ent_in_sphere
Reply With Quote #13

I guess I got it now, thanks to y'all guys, have a nice day! (Or night).

Last edited by nacho312; 03-13-2021 at 15:14.
nacho312 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 08:42.


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