Checking for an entity of type in a certain radius?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Checking for an entity of type in a certain radius?

Post by lizardkid »

is it possible? like this..

Code: Select all

//radius command

if($entity.model == static/bigbed.tik)
{

// laugh maniacally

}
i need the radius checking command mostly, and i'll be a monkey if i can't figure it out :S

thought a loop, but checking origins? how...

*brain explodes*
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

:D chill dude..
Do you need the bounds of the clip on the object?
Oops forget that, now I know what you are after...

I dont think radius is what you need, you could use a script_object with a setsize and check if any entities matching a model name are touching the script_object for a match though.
Grassy
An ambiguous question will get a similar answer...
Rindog
Corporal
Posts: 29
Joined: Wed Sep 24, 2003 6:34 pm

Post by Rindog »

vector_within

Code: Select all

 if (vector_within $player[local.i].origin $holsterspot.origin 500)
     {
         $player[local.i] holster
     } 
In this example, if the player goes within 500 world units of the holsterspot, they will be forced to holster their weapon.
Post Reply