ok, put this at the bottom of miscfunctions.qc or in func_radar.qc [note: func_radar.qc must come imediately after miscfunctions.qc in progs.src]
- Code: Select all
void () radar_think ={ local entity head; head = nextent (world); while (head != world) { if (head.health > 0) { if (head.classname == "player") { local vector bliporg; bliporg = '0 0 0'; bliporg_x = (head.origin_x / self.punchangle_x) + self.origin_x; bliporg_y = (head.origin_y / self.punchangle_y) + self.origin_y; bliporg_z = (head.origin_z / self.punchangle_z) + self.origin_z; local entity blip; blip = spawn (); setorigin (blip, bliporg); setmodel (blip, "progs/laserdot.spr"); blip.think = SUB_Remove; blip.nextthink = time + self.cnt; } } head = nextent (head); } self.think = radar_think; self.nextthink = time + self.cnt;};
void () func_radar ={ if (!self.model) setsize (self, '-100 -100 -100', '100 100 100'); else { setmodel (self, self.model); local vector org; org = '0 0 0'; org_x = (self.maxs_x + self.mins_x) / 2; org_y = (self.maxs_y + self.mins_y) / 2; org_z = (self.maxs_z + self.mins_z) / 2; setorigin (self, org); } if (!self.cnt) self.cnt = 1; self.punchangle = '0 0 0'; self.punchangle_x = 8192 / self.size_x; self.punchangle_y = 8192 / self.size_y; self.punchangle_z = 8192 / self.size_z; self.solid = SOLID_NOT; self.movetype = MOVETYPE_NONE; self.think = radar_think; self.nextthink = time + self.cnt;};
now save miscfunctions.qc is and open up cl_client.qc. Go to PutClientInServer, and just before that function add:
- Code: Select all
void () func_radar;
then at the end of PutClientInServer paste
- Code: Select all
if (!find (world, classname, "func_radar"))
{
local entity radar;
radar = spawn ();
radar.classname = "func_radar";
setorigin (radar, self.origin);
radar.think = func_radar;
radar.nextthink = time;
}
save and compile, then add func_radar to entities.def in your radiant folder. to make it 2d, remove z code for topview radar and y code for sideview.
