Raised This Month: $ Target: $400
 0% 

find_ent_in_sphere


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Schwabba
Senior Member
Join Date: Apr 2008
Old 10-19-2010 , 05:33   find_ent_in_sphere
Reply With Quote #1

I wanna remove all ent's 50 units around a player:

PHP Code:
    new origin[3]
    
get_user_origin(idorigin0)
    new 
ent = -1
    
while((ent find_ent_in_sphere(ent,origin,50.0)) != 0) { // warning 213: tag mismatch on this line
        
remove_entity(ent)
    } 
Schwabba is offline
issen1
Member
Join Date: Jan 2010
Old 10-19-2010 , 05:38   Re: find_ent_in_sphere
Reply With Quote #2

Code:
// find_ent_in_sphere ( StartEntity, Float:origin[3], Float:radius ) // -> new Float:origin[3]
__________________
greets (:
issen1 is offline
Schwabba
Senior Member
Join Date: Apr 2008
Old 10-19-2010 , 05:41   Re: find_ent_in_sphere
Reply With Quote #3

Same problem, but now on get_user_origin.

Last edited by Schwabba; 10-19-2010 at 05:45.
Schwabba is offline
issen1
Member
Join Date: Jan 2010
Old 10-19-2010 , 05:47   Re: find_ent_in_sphere
Reply With Quote #4

No, this time the tag mismatch comes from get_user_origin, because it's returning an int array.

You might consider using pev or entity_get_vector, because they are returning a float array. Not sure, though.
__________________
greets (:
issen1 is offline
Schwabba
Senior Member
Join Date: Apr 2008
Old 10-19-2010 , 06:25   Re: find_ent_in_sphere
Reply With Quote #5

PHP Code:
    new Float:origin[3];
    
pev(id,pev_origin,origin);
    new 
ent = -1
    
while((ent find_ent_in_sphere(ent,origin,50.0)) != 0) {
        
remove_entity(ent)
    } 
Now Server crashes :/

EDIT: LOL, i removed myself.. omg.. now it works.. thank you

Last edited by Schwabba; 10-19-2010 at 06:31.
Schwabba is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 10-19-2010 , 11:10   Re: find_ent_in_sphere
Reply With Quote #6

Write here, what the error was, then other people can search if they have the same problem.
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
issen1
Member
Join Date: Jan 2010
Old 10-19-2010 , 11:49   Re: find_ent_in_sphere
Reply With Quote #7

Quote:
Originally Posted by mottzi View Post
Write here, what the error was, then other people can search if they have the same problem.
He did write what the problem was. He removed his own player entity, thus stopping the LAN-server.

Edit: Look one post later. Thanks.
__________________
greets (:

Last edited by issen1; 10-20-2010 at 05:14.
issen1 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-19-2010 , 17:51   Re: find_ent_in_sphere
Reply With Quote #8

Quote:
Originally Posted by issen1 View Post
He did write what the problem was. He removed his own player entity, thus stopping the LAN-server.
Actually, if you use remove_entity() (or FM's EngFunc_RemoveEntity) on a player, the server will crash.
It wasn't specific to him being the LAN owner.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Schwabba
Senior Member
Join Date: Apr 2008
Old 10-19-2010 , 19:47   Re: find_ent_in_sphere
Reply With Quote #9

Exactly that was the problem.

Last edited by Schwabba; 10-21-2010 at 01:32.
Schwabba 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 10:19.


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