[FilterScript] Simple Vehicle Speedometer/Health/Vehicle Name
#1

Introduction

This is a simple FilterScript where it will display your vehicles statistics on the bottom of your screen in a textdraw. Version 2 now includes a vehicle menu. You can find whats new below.


Features

Version 1
  • Displays Vehicle Speed in KM/H
  • Displays Vehicle Health in a Percentage
  • Displays Vehicle Name
  • Simple Look
Version 2
  • Simple Vehicle Menu (/vehicle)
  • Vehicle menu is clickable, simply click on your option
  • Turn Vehicles Engine On/Off using the vehicle menu
  • Turn Vehicles Lights On/Off using the vehicle menu
Pictures

Version 1
Version 2


Download

Github


Bugs

None currently.

If you have any suggestions please let me know down below !
Reply
#2

Nice textdraws
Reply
#3

Quote:
Originally Posted by SecretBoss
View Post
Nice textdraws
Thank you !
Reply
#4

Good filterscript, thanks for sharing it.
Reply
#5

Quote:
Originally Posted by MrCreed
View Post
Good filterscript, thanks for sharing it.
Cheers! No problem.
Reply
#6

1.) You are using the the wrong type of textdraws. (Use player textdraws)
2.) You don't even destroy textdraws so this would eventually hit textdraw limit.
3.) Incorrect calculation for vehicle speed.
Reply
#7

Quote:
Originally Posted by Pottus
View Post
1.) You are using the the wrong type of textdraws. (Use player textdraws)
2.) You don't even destroy textdraws so this would eventually hit textdraw limit.
3.) Incorrect calculation for vehicle speed.
Cheers for the heads up, I've fixed them.
Reply
#8

Okay another problem is you don't loop through all the players in OnFilterScriptInit() and create the textdraws for any connected players. Another problem is you also don't delete any textdraws in OnFilterScriptExit().
Reply
#9

Updated to Version 2. A new 'Vehicle Menu' has been added!

Version 2:
  • Added Simple Vehicle Menu (/vehicle)
  • Vehicle menu is clickable, simply click on your option
  • Turn Vehicles Engine On/Off using the vehicle menu
  • Turn Vehicles Lights On/Off using the vehicle menu
Reply
#10

Nice.
Reply
#11

Quote:
Originally Posted by Edw
Посмотреть сообщение
Nice.
Thank you
Reply
#12

Pretty Nice
Reply
#13

Quote:
Originally Posted by Scripter18
Посмотреть сообщение
Pretty Nice
Thanks alot!
Reply
#14

There is a problem with the Health. When i crash the car still shows 100.
Reply
#15

Quote:
Originally Posted by dan40o
Посмотреть сообщение
There is a problem with the Health. When i crash the car still shows 100.
Are you sure? I just tested it and everytime I crashed into an object the health always went down.
Reply
#16

yes I am sure i'll post a picture wait a sec.
Reply
#17

Look
Reply
#18

Quote:
Originally Posted by dan40o
Посмотреть сообщение
Look
Honestly, I'm not too sure. It has to be something related to your script probably? Because it works find for me.
Reply
#19

Fixed it. I removed the loop under OnPlayerUpdate
Код:
public OnPlayerUpdate(playerid)
{
	if(IsPlayerInAnyVehicle(playerid))
	{
		new vspeed[25];
		format(vspeed, sizeof(vspeed), "Speed: ~y~%d ~g~KM/H", GetVehicleSpeed(playerid));
		PlayerTextDrawSetString(playerid, VehicleSpeed[playerid], vspeed);
		
		new vhealthtd[32], Float:vHealth;
		GetVehicleHealth(GetPlayerVehicleID(playerid), vHealth);
		new Float:percentage = (((vHealth - 250.0) / (1000.0 - 250.0)) * 100.0);
		
		format(vhealthtd, sizeof(vhealthtd), "Vehicle Health: ~g~%.0f%", percentage);
		PlayerTextDrawSetString(playerid, VehicleHealth[playerid], vhealthtd);
	}
	return 1;
}
Reply
#20

NICE!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)