When I shouldn't use SetTimer(Ex) that has less than 1000 ms?
#1

I want to create a speedometer, but I would like to see the speed increasing and decreasing everytime, not for each second.

@EDIT: Sorry for my english, if it's bad.
Reply
#2

What is the question?
Just use a value lesser than 1000.
pawn Код:
SetTimerEx("UpdatePlayerSpeed", 100, true, "i", playerid);
Reply
#3

I heard that the minimum must be 1000, cause it lags the server.
Reply
#4

You should use OnPlayerUpdate for that then. Whenever youre going below 100 or 200ms intervals you could just use OnPlayerUpdate so theres no overhead for running the timer.
Calculating and updating the speed isnt a big task, so it would be fine.
Reply
#5

Quote:
Originally Posted by Rodney Francalim
Посмотреть сообщение
I heard that the minimum must be 1000, cause it lags the server.
I don't think there is a minimum. You can set it to 1, updating 1000 times a second.
Of course the more updates the bigger the "lags", but minor tasks like speed calculation won't slow your server down by a noticable amount. So 200-300ms should be fine I think, unless you have 1000 players in your server all driving in a vehicle simultaneously.
Reply
#6

it's not minimum = 1000
Depend on Host and How much CPU and RAM you have , Well making it 100 will excute the same function 10time more than as it was , so it may use more resurce

Sorry , bad english
Reply
#7

Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)