Posts
145
Respect
38Add +1
Forum Rank
Pack-a-Puncher
Primary Group
Member
Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!function tp_near_trigger()
{
trigger = GetEnt("NAME OF THE TRIGGER", "targetname");
origin = trigger.origin;
range = 50;
rangeSQ = range**2; //Since we're using distanceSquared
AI = GetAITeamArray("axis");
for(i = 0; i < AI.size; i++)
{
if(isDefined(AI[i].is_brutus))
continue;
if(isDefined(AI[i]) && isAlive(AI[i]))
{
if(DistanceSquared(origin, AI[i].origin) <= rangeSQ)
AI[i] SetOrigin(DESTINATION ORIGIN);
}
}
}If you don't want to do this with zones, I'm sure you can do something like this:I didn't test this I just though, but you should be able to see what I mean. Code SnippetPlaintextfunction tp_near_trigger()
{
trigger = GetEnt("NAME OF THE TRIGGER", "targetname");
origin = trigger.origin;
range = 50;
rangeSQ = range**2; //Since we're using distanceSquared
AI = GetAITeamArray("axis");
for(i = 0; i < AI.size; i++)
{
if(isDefined(AI[i].is_brutus))
continue;
if(isDefined(AI[i]) && isAlive(AI[i]))
{
if(DistanceSquared(origin, AI[i].origin) <= rangeSQ)
AI[i] SetOrigin(DESTINATION ORIGIN);
}
}
}
Cronex's way is great too
Double Post Merge: December 02, 2016, 06:53:48 pm
Sorry for my typos (not in the code) lol
you can use this Thread :
https://ugx-mods.com/forum/index.php/topic,14009.msg144108.html#msg144108