SA-MP Forums Archive
TextDraw Speed meter - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: TextDraw Speed meter (/showthread.php?tid=659852)



TextDraw Speed meter - KamilPolska - 18.10.2018

Hey. I am looking for and I can not find an interesting script on the speed meter. I wanted a speed meter with colors.
E.g:
0 km/h - 82 km/h - Green color
83 km/h - 101 km/h - Light green color
102 km/h - 123 km/h - Yellow color
124 km/h - 144 km/h - Orange color
145 km/h - 173 km/h - Dark orange color
174 km/h - MAX km/h - Red color


Re: TextDraw Speed meter - Wajttachu - 18.10.2018

Easy lmao, pm me


Re: TextDraw Speed meter - v1k1nG - 18.10.2018

https://sampforum.blast.hk/showthread.php?tid=641735
https://sampforum.blast.hk/showthread.php?tid=435751
https://sampforum.blast.hk/showthread.php?tid=545128

And if you keep searching...


Re: TextDraw Speed meter - KamilPolska - 18.10.2018

/del


Re: TextDraw Speed meter - KamilPolska - 20.10.2018

I have a question. How to do it and is it best to do it in OnPlayerUpdate or OnPlayerStateChange?


Re: TextDraw Speed meter - UFF - 20.10.2018

Quote:
Originally Posted by KamilPolska
View Post
I have a question. How to do it and is it best to do it in OnPlayerUpdate or OnPlayerStateChange?
OnPlayerStateChange is to show the textdraw and hide it (Detects if player is in vehicle or not)
OnPlayerUpdate can also be used to update the textdraw.


Re: TextDraw Speed meter - KamilPolska - 20.10.2018

I understand. But can also use SetTimer in OnGameModeInit and not OnPlayerUpdate, right?


Re: TextDraw Speed meter - UFF - 20.10.2018

Quote:
Originally Posted by KamilPolska
View Post
I understand. But can also use SetTimer in OnGameModeInit and not OnPlayerUpdate, right?
Yeah, that will also work.


Re: TextDraw Speed meter - KamilPolska - 20.10.2018

Okay. I did. And you know how can do, for example, the speed reaches 50, it changes to a different color.


Re: TextDraw Speed meter - Cypress - 20.10.2018

Don't use OnPlayerUpdate for such things. I've seen many people having the same question.

One example is in this topic

https://sampforum.blast.hk/showthread.php?tid=591965

There are also plenty of speedometer scripts available as an example. The color part should be easier. Search for a decent speedometer script and see how it works, then just add your own textdraw and change the colors according to the speed.