SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 18/10/2018, 05:02 PM   #1
KamilPolska
Huge Clucker
 
Join Date: May 2016
Location: Poland
Posts: 498
Reputation: 5
Default TextDraw Speed meter

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
KamilPolska is offline   Reply With Quote
Old 18/10/2018, 05:50 PM   #2
Wajttachu
Little Clucker
 
Join Date: Oct 2018
Location: Belgrade, Serbia
Posts: 20
Reputation: 0
Default Re: TextDraw Speed meter

Easy lmao, pm me
Wajttachu is offline   Reply With Quote
Old 18/10/2018, 07:17 PM   #3
v1k1nG
Huge Clucker
 
v1k1nG's Avatar
 
Join Date: Feb 2018
Posts: 497
Reputation: 35
Default Re: TextDraw Speed meter

https://forum.sa-mp.com/showthread.php?t=641735
https://forum.sa-mp.com/showthread.php?t=435751
https://forum.sa-mp.com/showthread.php?t=545128

And if you keep searching...
__________________
My test server: 51.91.122.18:7778
My Discord contact: [SF]kAn3#9933
YT https://www.youtube.com/channel/UCrM...QtP2pczguqvppw
v1k1nG is offline   Reply With Quote
Old 18/10/2018, 09:33 PM   #4
KamilPolska
Huge Clucker
 
Join Date: May 2016
Location: Poland
Posts: 498
Reputation: 5
Default Re: TextDraw Speed meter

/del

Last edited by KamilPolska; 20/10/2018 at 11:48 AM.
KamilPolska is offline   Reply With Quote
Old 20/10/2018, 11:50 AM   #5
KamilPolska
Huge Clucker
 
Join Date: May 2016
Location: Poland
Posts: 498
Reputation: 5
Default Re: TextDraw Speed meter

I have a question. How to do it and is it best to do it in OnPlayerUpdate or OnPlayerStateChange?
KamilPolska is offline   Reply With Quote
Old 20/10/2018, 12:33 PM   #6
UFF
Banned
 
Join Date: Feb 2018
Location: Funky World
Posts: 346
Reputation: 28
Default Re: TextDraw Speed meter

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.
UFF is offline   Reply With Quote
Old 20/10/2018, 02:09 PM   #7
KamilPolska
Huge Clucker
 
Join Date: May 2016
Location: Poland
Posts: 498
Reputation: 5
Default Re: TextDraw Speed meter

I understand. But can also use SetTimer in OnGameModeInit and not OnPlayerUpdate, right?
KamilPolska is offline   Reply With Quote
Old 20/10/2018, 03:12 PM   #8
UFF
Banned
 
Join Date: Feb 2018
Location: Funky World
Posts: 346
Reputation: 28
Default Re: TextDraw Speed meter

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.
UFF is offline   Reply With Quote
Old 20/10/2018, 03:31 PM   #9
KamilPolska
Huge Clucker
 
Join Date: May 2016
Location: Poland
Posts: 498
Reputation: 5
Default Re: TextDraw Speed meter

Okay. I did. And you know how can do, for example, the speed reaches 50, it changes to a different color.
KamilPolska is offline   Reply With Quote
Old 20/10/2018, 03:46 PM   #10
Cypress
Gangsta
 
Cypress's Avatar
 
Join Date: Dec 2009
Location: Germany
Posts: 937
Reputation: 127
Default Re: TextDraw Speed meter

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

One example is in this topic

https://forum.sa-mp.com/showthread.php?t=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.
__________________

Welcome stranger. I like your attitude.
Cypress is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Speed-o-meter RomaNScripteR Server Support 2 22/07/2017 12:50 PM
[FilterScript] Speed-O-Meter with GPS SomebodyAndMe Filterscripts 17 09/07/2016 12:52 PM
Speed-o-meter Color Axey187 Scripting Help 12 02/10/2013 11:43 AM
[BUG] The Speed-o-Meter and Fuel-o-Meter is not appearing! [UNSOLVED!!!] Rand_Omar Help Archive 12 28/01/2011 02:17 PM
Textdraw similar to Speed-O-Meter Overlay problem :( saiberfun Help Archive 29 11/03/2009 01:34 AM


All times are GMT. The time now is 03:40 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.