I'm currently using the function Vector:ToScreen() to display information about entities that I want to be displayed in the sky across the map, however depending on where you are standing it will still show the information but won't update it if you know what I mean.
In example: The text is counting down from 100 and as I'm walking away farther from the entity's position it will stop at 93, but when I get closer say 10 seconds later it will say 83 and resume counting. Is there an alternative to this?
I presume the ToScreen is being called from the entities cl file? If that is so then the reason the text stops updating is because of you entering a different [url=https://developer.valvesoftware.com/wiki/PVS]PVS[/url], if I'm not mistaken.
A workaround would be to have a server/client [url=http://wiki.garrysmod.com/page/Using_the_net_library]net library[/url] that keeps the client updated regardless of their position on the map.
I'm actually calling it like this in a HUDPaint hook
[lua]
for k,territory in pairs(ents.FindByClass("territory")) do
TERRITORY:DrawTerritories(territory)
end
[/lua]
and then in the DrawTerritories function I'm just getting the entity's position and positioning it to the LocalPlayer's screen
Ahh, because ents.FindByClass is being called on the client its only loading entities in the players PVS. What I would do is have a server hook that gets all the territories and sends their position/toscreen to the players that need the information. Then on the clients have a net hook that updates the territories information for the hudpaint.
Do all the players need to see this information or just specific ones? If so just use a net.Broadcast and have the clients check distance and only hudpaint when necessary.
Thanks for the help, it draws it regardless of your position now.
Sorry, you need to Log In to post a reply to this thread.