What Would be better
#1

I have a timer running every 700 milli seconds to update 4 textdraws for a vehicle's speedo, would it be faster to use onplayerupdate as in this timer of 700 milli seconds it loops through all players to check if there in vehicles speed etc.. what would be more efficent could some one reply that knows what there on about.
Reply
#2

I wouldn't use OnPlayerUpdate for something like this because it checks so fast. It wouldn't be necessary. I would have it set a timer for each player whenever they enter a vehicle.
Reply
#3

Well, what type of server do you have and what is your max alloted players?
Reply
#4

Delete..
Reply
#5

Quote:
Originally Posted by Cem
I have a timer running every 700 milli seconds to update 4 textdraws for a vehicle's speedo, would it be faster to use onplayerupdate as in this timer of 700 milli seconds it loops through all players to check if there in vehicles speed etc.. what would be more efficent could some one reply that knows what there on about.
Would it be better to run a timer for each time a player enter's a vehicle instead of one timer always running and loops all players?
Reply
#6

That's what I would do.
Reply
#7

Quote:
Originally Posted by Cem
Quote:
Originally Posted by Cem
I have a timer running every 700 milli seconds to update 4 textdraws for a vehicle's speedo, would it be faster to use onplayerupdate as in this timer of 700 milli seconds it loops through all players to check if there in vehicles speed etc.. what would be more efficent could some one reply that knows what there on about.
Would it be better to run a timer for each time a player enter's a vehicle instead of one timer always running and loops all players?
Yes, that would be a good idea. Say your server holds... 200 people, well, maybe about 127 of them will be in a car... That isn't too bad, just make sure you don't have a timer checking each and every player! That would lag the hell out of your server.
Reply
#8

Quote:
Originally Posted by Baked-Banana
That's what I would do.
I also have a timer running every second looping all connected players checking things like health money seconds, that's it really is there any need to make that a set timer for each player instead, also what is the max amount of timer's if anyone knows.
Reply
#9

There really isn't a max amount of timers as far as I know. It's just kind of discouraged to use too many because it can cause server lag. It just kinda depends on the amount of timers, the speed at which they get called, and what the timers are doing.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)