Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(entity e = world; (e = nextent(e));)
- {
- // make sure the player is solid
- if(e.classname != "debug_waypoint")
- continue;
- vector camera_position = getproperty(VF_ORIGIN);
- traceline(camera_position, e.origin, MOVE_NOMONSTERS, self);
- // Did the trace make it to the player before hitting something?
- if(trace_fraction != 1)
- continue;
- vector vec = project(e.origin + [0, 0, e.maxs_z]);
- // is he behind us?
- if(vec_z < 0)
- {
- continue;
- }
- // make the text size depend on how far the entity is
- // get the cameras angles
- makevectors(view_angles);
- // get position 16 upper left from entity
- vector topleft = project(e.origin + v_right*-16 + v_up*16);
- // get position 16 lower right from entity
- vector bottomright = project(e.origin + v_right*16 + v_up*-16);
- //whats the difference?
- vector text_size = bottomright - topleft;
- // a little adjustment!
- text_size *= 0.4;
- drawstring (vec, ftos(e.damage), text_size, RGB_Orange, 1, 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement