findradius in CSQC?
Moderator: InsideQC Admins
4 posts
• Page 1 of 1
findradius in CSQC?
I'm not sure what I'm doing wrong here, the code works just fine in SVQC, but it doesn't work at all in CSQC. Did I do something wrong?
- Code: Select all
local entity blip;
blip = findradius(self.origin, 300);
while(blip)
{
if(blip != self)
{
if(blip.classname == "player")
{
centerprint(blip.netname); //Yes, thats all I'm doing, just to see if the dang code works!
}
}
blip = blip.chain;
}
- Ghost_Fang
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
Re: findradius in CSQC?
hhmm, Im not sure it detects the entity at the self.origin , all the code I have studied so far will check for world or other things , but nothing about self.
- Code: Select all
e = findradius (self.origin, 75);
while ((e != world))
{
if ((e.classname == "trigger_teleport"))
{
ObserverTeleporter (self, e);
e = world;
}
e = e.chain;
if (!e)
{
e = world;
}
}
-

Cobalt - Posts: 445
- Joined: Wed Jun 10, 2009 2:58 am
- Location: New England, USA
Re: findradius in CSQC?
csqc is not ssqc. that is the entities in ssqc only exist in csqc if you create them, either through the SendEntity stuff or from spawn() in the csqc. Either way you need to explicitly set the classname within csqc or it'll be blank.
findradius works purely on origin (and usually solidity), it doesn't care about self (and will thus return it as it would any other entity), but will ignore world.
findradius works purely on origin (and usually solidity), it doesn't care about self (and will thus return it as it would any other entity), but will ignore world.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Re: findradius in CSQC?
So would I call that findradius function in ssqc then the found entities moved to csqc via addentity, then do my stuff from there?
- Ghost_Fang
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest