I have an anticamp script ...and when someone camp i want to atach this icon above his head.
Code:
doheadicon()
{self.headIcon = newHudElem();
self.headIcon.x = self.origin[0];
self.headIcon.y = self.origin[1];
self.headIcon.z = self.origin[2] + 50;
self.headIcon.alpha = 0.85;
self.headIcon setShader( "waypoint_kill", 10,10 );
self.headIcon setWaypoint( true, true, false );
self thread updateHeadIcon();
}
updateHeadIcon()
{
self endon("death");
for(;;)
{
self.headIcon.x = self.origin[0];
self.headIcon.y = self.origin[1];
self.headIcon.z = self.origin[2] + 50;
wait 0.1;
}
}
DoCamp()
{
bla bla bla
if(self is camping)
{
self thread doheadicon();
}
}
And i add this line
Code:
precacheShader( "waypoint_kill);
on init() thread.