A question about OnPlayerUpdate
#1

Hi,

I saw some people said this might cause issues so I want to make sure. I've made an HP Textdraw that updates Its color by the value (40 = red, 100 = green etc.)

That piece of code was OnPlayerDamage callback, but we've encountered problems, I'll explain:
Let's say I have 40 HP which means my TD color is Red, After I use /sethp command let's say I set my HP value to 60 It will stay red UNLESS I damage my self (OnPlayerDamage callback), Only then the callback will read the code and update my health.

So, I thought I'd better put that piece of code on OnPlayerUpdate, but some people said it might cause issues if a lot of players are in-game and it might cause lag or stuff like that.

Is that true or Is it harmless?
Reply
#2

You should update the textdraws in OnPlayerDamage, OnPlayerDeath, and a ~150ms timer to account for any other occurrences. OnPlayerUpdate would be fine for a small thing like this, but things add up so it's best to go with a timer.
Reply
#3

Alright thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)