Jump to content

onClientRender


Drakath

Recommended Posts

Posted
This event and onClientPreRender will trigger whatever function it is attached to with every frame. Depending on the server's maximum FPS and what your computer might handle - you might end up triggering the function 30-60 times per second.

As a result, this event may cause severe lag and/or even crashes if not used cautiously.

Posted

If used to much , yes , it could cause lag to the client .

But there are alot of variables that play in wether it lags the client or not .

CPU and GPU play a big role here though . Depends from case to case.

Posted

I suggest you add timer and output how long your callback took on each call (outputting time might be slow itself, keep that in mind), extra 0-3ms is very OK in my opinion.

Posted

The main usage of that event is basically if you want to draw a text for instance with dxdrawtext, I'm using it in multiple resources and every frame it calls getElementData to verify if it should write anything, defines around 0-10 local variables (to calculate distance between some objects and output it), and some more. Let's not forget thought that this is a client sided function so the performance required to use it will be provided by the client computers and not the server. As long you doesn't add really heavy CPU wasting code in it there won't be any problem.

  • Moderators
Posted

Just, try to reduce the amount of handlers, then you will be fine.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

It really depends on what you're gonna do using those events.

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...