Raised This Month: $ Target: $400
 0% 

Entity and radius


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Kiske
Veteran Member
Join Date: May 2009
Old 06-14-2014 , 08:43   Entity and radius
Reply With Quote #1

Hi,
I have a problem with an entity and his radius.


PHP Code:
set_task(0.1"entityThink"entity__"a"100);

public 
entityThink(const entity) {
static 
Float:vecEntityOrigin[3];
static 
Float:vecIdOrigin[3];
static 
iEnt;

entity_get_vector(iEntEV_VEC_originvecEntityOrigin);
iEnt = -1;

while((
iEnt find_ent_in_sphere(iEntvecEntityOrigin330.0)) != 0) {
if(!
is_user_alive(iEnt)) {
continue;
}

entity_get_vector(iEntEV_VEC_originvecIdOrigin);

if(
get_distance_f(vecIdOriginvecEntityOrigin) > 300.0) {
set_user_godmode(iEnt0);
continue;
}

set_user_godmode(iEnt1);
}

The result of that code it's this (example, view of top):






Buuuut, what happens when there are two entities like this close enough, something like that (example, view of top):



The 'User with problem' has godmode for the 'Entity 1' and hasn't godmode for the 'Entity 2'.

How to fix that ?
__________________


Last edited by hornet; 06-14-2014 at 09:40. Reason: It is a violation of the forum rules to blank out your post
Kiske is offline
Send a message via Skype™ to Kiske
 



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 21:13.


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