Raised This Month: $ Target: $400
 0% 

Radius around a player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 07-13-2011 , 19:05   Radius around a player
Reply With Quote #1

I have found a few different methods of doing this but none of them really what im looking for..

I need one where i can set a radius around certain players if they match a class.

The ones i have found and tested.. i cant seem to place the radius around a single player.

Help with code or just keywords to search would be greatly appreciated

Thanks
Doc-Holiday is offline
!Morte
Veteran Member
Join Date: May 2010
Old 07-13-2011 , 20:14   Re: Radius around a player
Reply With Quote #2

Use FindEntityInSphere
__________________
First Zombie Class
[ZP] Zombie Class: Houndeye Zombie
Quote:
Originally Posted by lucas_7_94 View Post
tenes que saber pawn antes de intentar hacer algo digno.
!Morte is offline
Send a message via MSN to !Morte Send a message via Skype™ to !Morte
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 07-16-2011 , 03:15   Re: Radius around a player
Reply With Quote #3

So... i played around using that FindEntityInSphere... and found a tut by Jor.. i belive...

for some reason it finds all entities just fine but cant seem to pick up the class "player"..

any one know of some examples i can look at when i searched for that in "Scripting" only like 4 threads where there

i believe its because it only gets the closest ent... i need all of the "player" ents. in the sphere.

Last edited by Doc-Holiday; 07-16-2011 at 03:17.
Doc-Holiday is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-16-2011 , 03:45   Re: Radius around a player
Reply With Quote #4

IIRC, you have to loop through the entites using the find ent in sphere function.
__________________
fysiks is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 07-16-2011 , 04:05   Re: Radius around a player
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
IIRC, you have to loop through the entites using the find ent in sphere function.
https://forums.alliedmods.net/showth...EntityInSphere

Thats what i found. but it seems to only find the closest one.
Doc-Holiday is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-16-2011 , 06:21   Re: Radius around a player
Reply With Quote #6

Doesn't find_sphere_class work ?
(It also uses FIND_ENTITY_IN_SPHERE so if that one doesn't work the other one should fail in the same way...).

Also, if you only need to retrieve players, just use get_players native and check entity_range.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 07-16-2011 , 07:35   Re: Radius around a player
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
Doesn't find_sphere_class work ?
(It also uses FIND_ENTITY_IN_SPHERE so if that one doesn't work the other one should fail in the same way...).

Also, if you only need to retrieve players, just use get_players native and check entity_range.
Thanks for the info about entity_range... thats what im using like the attatched plugin... does exactly what i want it to do

**Might not be the most efficient way**
Attached Files
File Type: sma Get Plugin or Get Source (test.sma - 642 views - 978 Bytes)
Doc-Holiday is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-16-2011 , 07:40   Re: Radius around a player
Reply With Quote #8

Sorry for asking something other. Can someone tell me the difference between these 2 natives?

http://www.amxmodx.org/funcwiki.php?go=func&id=397

http://www.amxmodx.org/funcwiki.php?go=func&id=330
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-16-2011 , 07:48   Re: Radius around a player
Reply With Quote #9

That's something you could find by yourself... You see get_entity_distance is an engine stock, and since you know you have to search before posting (you know right?) you go to engine_stocks.inc and you see what -magic- return floatround(entity_range(ent1, ent2)); and you have your answer.
__________________
Arkshine is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-16-2011 , 08:21   Re: Radius around a player
Reply With Quote #10

Quote:
Originally Posted by Arkshine View Post
(you know right?)
Nope.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu 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 01:03.


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