[Tutorial] Speedo with Timer
#21

hmm no? i went up to 300-320km/h.... i think in mph it's about 250? try with an hydra, and on car use nos, u'll see it goes much over...
Reply
#22

Don't use a timer - run it every couple of times OnPlayerUpdate gets called.

Don't use floatsqroot, it's awfully slow it would probably be much better to use something like this,

floatmul( floatabs(X) + floatabs(Y) + floatabs(Z), 100);
Reply
#23

well i think it's alright like it, not slow or no lag, but it's sure that if i'de have over 20timers it would start to, but as i use it i only have 3 timers, not all of them calling at 100ms. And anyway i don't get what you mean with onplayerupdate.... wouldn't it lag much more with more players?
Reply
#24

haha np :P
Reply
#25

Its the best speedometer what I saw, but how can I do radar: if(IsPlayerInVehicle(playerid) == 296) { if(IsPlayerInRangeOfPoint(i,30, pX,pY,pZ)) { if(IsPlayerInAnyVehicle(i)) { ? Thanks.
Reply
#26

thanks for the comment, but i don't get what you mean with radar :*\
Reply
#27

I want police radar in police car. When player1 is police and is in police car and near is player2 who is in any car and go 100 km/h so player1 (policeman) get message about his speed. Thanks.
Reply
#28

wooow, you're asking for a script right now, go in script request thread.. not here
Reply
#29

But I want police radar which is compatible with your speedometer. And I dont know how to do it Please help.
Reply
#30

So can you tell me how can I do if(final_speed_int(i) < 80) please? Thanks very much.
Reply
#31

sorry, but go on scripting discussion, ask for a script, refer to my tutorial if you want it to work with my speedo! this is TUTORIAL section -.- don't spam my comments section with script requests xD thanks
Reply
#32

hell this is so COOL !!!
Thanks and realy this saved me from searching much time
Reply
#33

If I recall correctly, you need to use SetTimerEx to use playerid in the callback of the timer, if you would use SetTimer, it will return 0.
Reply
#34

no problem rafa :P

and slopro, that's not true, the speedo works anyway.. did you tried it?
Reply
#35

Why must a timer in a speedo :O?
Reply
#36

Quote:
Originally Posted by Tijger
View Post
Why must a timer in a speedo :O?
Obviously something needs to update the textdraw with the correct speed the player drives ^^.
Reply
#37

The timer is set to 100ms but the speedo update is not so fast ca 1,5s why?
Reply
#38

hmm, can someone tell me how to do it to MPH?
Reply
#39

// 250.666667 = kmph // 199,4166672 = mph in floatsqroot
Reply
#40

nice

8char
Reply


Forum Jump:


Users browsing this thread: 8 Guest(s)