SetTimerEx being called for one person only?
#1

I'm almost certain this has been answered before, and I remember seeing it somewhere...but my script is only calling SetTimerEx for a specific playerid, when it should call for any playerid:



Yes, FlyTimer is defined for MAX_PLAYERS, this section of script is under a command, and FreeCam is a public function:

Reply
#2

You want it to loop/repeat...? That may be the issue... If it's too busy looping for a specific player it might not end up working for the player you want it to. Just a thought.
Reply
#3

I don't think that's the issue.
Reply
#4

use a loop

edit; dont use "25", its called in ms, so using 25 is worse than using OnPlayerUpdate
Reply
#5

Quote:
Originally Posted by Mionee
Посмотреть сообщение
use a loop

edit; dont use "25", its called in ms, so using 25 is worse than using OnPlayerUpdate
So would changing to 250 be more efficient? I used 25 in order to be sure that the timer was looping as fast as possible. I didn't know it could stop other loops from functioning.
Reply
#6

Quote:
Originally Posted by Aerotactics
Посмотреть сообщение
So would changing to 250 be more efficient? I used 25 in order to be sure that the timer was looping as fast as possible. I didn't know it could stop other loops from functioning.
Use 1000, which is one second. Also, I doubt it stops other loops from functioning, but judging from your code you're only making the timer function for one player and not more, so it's rather obvious it only works for one player.

Use foreach to loop through all players and then use your code
Reply
#7

The problem with that is, it needs to loop at 25 ms to keep the movement of an object as smooth as possible, else the object moves jerky and static-like.

I'm not trying to make the timer start for all players at once, only the player who used the command. For now, it only works on ID 0, or the first player to use the command, I'm guessing.
Reply
#8

It doesn't need to run on 25 ms, because if it does it'll be going faster than necessary. Using 25ms is extremely inefficient as well.

Also, if you showed us your actual code instead of 3 line snippets we'd be able to help you better.
Reply
#9

Quote:
Originally Posted by Mionee
Посмотреть сообщение
It doesn't need to run on 25 ms, because if it does it'll be going faster than necessary. Using 25ms is extremely inefficient as well.

Also, if you showed us your actual code instead of 3 line snippets we'd be able to help you better.
100 ms makes the object move static-like, 250 is even worse. I may have figured out the problem...
Reply
#10

You are probably better using OPU than a timer to be honest.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)