AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ent sphere (https://forums.alliedmods.net/showthread.php?t=63577)

Alka 11-24-2007 17:11

Ent sphere
 
Oh, hi. Actually i want to check if in sphere of a player there is no ent. I know how to get if there is an ent, but dunno how to check if there isn't.

Thanks.

Lord of Destruction 11-24-2007 17:18

Re: Ent sphere
 
Quote:

Originally Posted by Alka
[Hate n00bs]

me too
This is SO FUNNY

+I seriously hope I got you wrong^^

hlstriker 11-24-2007 17:27

Re: Ent sphere
 
Check for ents, then if nothing returns that means there aren't any?

Alka 11-24-2007 17:47

Re: Ent sphere
 
Quote:

Originally Posted by Lord of Destruction (Post 556382)
me too
This is SO FUNNY

+I seriously hope I got you wrong^^

What ?! What is the relevance between my post and yours ?! o.O
Go find another post...

@hlstriker - hmm,

Code:

new Ent = -1;
 while((Ent = engfunc(EngFunc_FindEntityInSphere, Ent, Origin, 100.0)) != 0)
 {
      //Finded a ent... duh
 }

but...should i do a count or something ?! <.<

hlstriker 11-24-2007 17:56

Re: Ent sphere
 
PHP Code:

new Ent engfunc(EngFunc_FindEntityInSphere, -1Origin100.0);
if(!
Ent)
    
client_print(0print_chat"Didn't find any entities.");
else
    
client_print(0print_chat"Found entity %i."Ent); 


Alka 11-24-2007 19:47

Re: Ent sphere
 
lawl, i know this, but i thought there is another way, hmm...dunno at what i was think...nvm. Thanks anyway.

purple_pixie 11-26-2007 04:14

Re: Ent sphere
 
Surely it would always return the player?

hlstriker 11-26-2007 04:40

Re: Ent sphere
 
Yes, if you are using the players origin. Which in his case it looks like he is.

Looks like you might have to loop through all the entities and if it's the player who you are checking just skip it.

[ --<-@ ] Black Rose 11-26-2007 04:49

Re: Ent sphere
 
Isn't the weapon an ent too?
Information? We won't steal your idea.

Alka 11-26-2007 08:59

Re: Ent sphere
 
@purple_pixie - Yes, if you do new Ent = engfunc(...) != 0;
@hlstriker - Yes, i do while(...) ;-) and skip the current ent.
@Black Rose - Yes, it is , but i'm not using this with players...


All times are GMT -4. The time now is 01:20.

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