Code:
//self = the player entity who will see the waypoint
//nem = the player entity who will have the waypoint above his head
setWaypoint(nem)
{
nem endon("disconnect");
self.NemWay = NewClientHudElem(self);
self.NemWay.x = nem.origin[0];
self.NemWay.y = nem.origin[1];
self.NemWay.z = nem.origin[2];
self.NemWay setShader("waypoint_kill");
self.NemWay setWaypoint(true,"waypoint_kill");
self.NemWay setTargetEnt(Nem);
}
The position will update automatically, no need to put it in a loop. Delete with self.NemWay destroy(); (it will also disappear when the player dies and come back when the player respawns