#include <a_samp>
forward ShowSpeedometer(playerid);
forward HideSpeedometer(playerid);
new Text:Speedometer_Global[2];
new PlayerText:Speedometer_Player[MAX_PLAYERS][31];
new bool:IsSpeedometerVisible[MAX_PLAYERS];
new bool:IsSpeedometerBarVisible[MAX_PLAYERS][30];
enum vD { Float:MaxSpeed };
new VehicleData[212][vD] = {
{ 146.0 }, { 146.0 }, { 186.0 }, { 106.0 }, { 136.0 }, { 151.0 }, { 96.0 }, { 156.0 }, { 96.0 }, { 166.0 },
{ 146.0 }, { 226.0 }, { 146.0 }, { 146.0 }, { 126.0 }, { 216.0 }, { 141.0 }, { 186.0 }, { 136.0 }, { 146.0 },
{ 166.0 }, { 166.0 }, { 151.0 }, { 131.0 }, { 156.0 }, { 186.0 }, { 186.0 }, { 156.0 }, { 156.0 }, { 186.0 },
{ 176.0 }, { 116.0 }, { 66.0 }, { 166.0 }, { 186.0 }, { 106.0 }, { 146.0 }, { 146.0 }, { 146.0 }, { 146.0 },
{ 146.0 }, { 61.0 }, { 136.0 }, { 136.0 }, { 96.0 }, { 151.0 }, { 176.0 }, { 186.0 }, { 176.0 }, { 136.0 },
{ 106.0 }, { 226.0 }, { 176.0 }, { 176.0 }, { 176.0 }, { 126.0 }, { 146.0 }, { 146.0 }, { 151.0 }, { 146.0 },
{ 186.0 }, { 176.0 }, { 176.0 }, { 176.0 }, { 61.0 }, { 61.0 }, { 146.0 }, { 146.0 }, { 176.0 }, { 186.0 },
{ 156.0 }, { 146.0 }, { 176.0 }, { 176.0 }, { 146.0 }, { 146.0 }, { 186.0 }, { 186.0 }, { 136.0 }, { 151.0 },
{ 186.0 }, { 106.0 }, { 136.0 }, { 106.0 }, { 176.0 }, { 146.0 }, { 86.0 }, { 186.0 }, { 186.0 }, { 156.0 },
{ 156.0 }, { 146.0 }, { 146.0 }, { 176.0 }, { 206.0 }, { 156.0 }, { 186.0 }, { 186.0 }, { 126.0 }, { 126.0 },
{ 146.0 }, { 61.0 }, { 206.0 }, { 206.0 }, { 146.0 }, { 156.0 }, { 216.0 }, { 151.0 }, { 126.0 }, { 106.0 },
{ 126.0 }, { 186.0 }, { 186.0 }, { 186.0 }, { 106.0 }, { 106.0 }, { 151.0 }, { 151.0 }, { 146.0 }, { 186.0 },
{ 186.0 }, { 176.0 }, { 176.0 }, { 176.0 }, { 96.0 }, { 146.0 }, { 146.0 }, { 146.0 }, { 156.0 }, { 146.0 },
{ 46.0 }, { 56.0 }, { 126.0 }, { 186.0 }, { 146.0 }, { 146.0 }, { 146.0 }, { 96.0 }, { 96.0 }, { 136.0 },
{ 146.0 }, { 216.0 }, { 146.0 }, { 151.0 }, { 156.0 }, { 146.0 }, { 146.0 }, { 146.0 }, { 186.0 }, { 146.0 },
{ 146.0 }, { 151.0 }, { 146.0 }, { 186.0 }, { 156.0 }, { 166.0 }, { 96.0 }, { 96.0 }, { 186.0 }, { 186.0 },
{ 186.0 }, { 186.0 }, { 186.0 }, { 186.0 }, { 61.0 }, { 186.0 }, { 146.0 }, { 146.0 }, { 156.0 }, { 96.0 },
{ 96.0 }, { 76.0 }, { 46.0 }, { 96.0 }, { 46.0 }, { 146.0 }, { 146.0 }, { 186.0 }, { 96.0 }, { 146.0 },
{ 151.0 }, { 176.0 }, { 146.0 }, { 156.0 }, { 106.0 }, { 151.0 }, { 176.0 }, { 186.0 }, { 126.0 }, { 186.0 },
{ 96.0 }, { 106.0 }, { 186.0 }, { 186.0 }, { 46.0 }, { 176.0 }, { 186.0 }, { 186.0 }, { 186.0 }, { 146.0 },
{ 151.0 }, { 96.0 }, { 186.0 }, { 186.0 }, { 146.0 }, { 151.0 }, { 146.0 }, { 146.0 }, { 146.0 }, { 126.0 },
{ 146.0 }, { 146.0 }
};
public OnFilterScriptInit() {
Speedometer_Global[0] = TextDrawCreate(624.000000, 432.999908, \"usebox\");
TextDrawLetterSize(Speedometer_Global[0], 0.000000, -0.337033);
TextDrawTextSize(Speedometer_Global[0], 543.500000, 0.000000);
TextDrawAlignment(Speedometer_Global[0], 1);
TextDrawColor(Speedometer_Global[0], 0);
TextDrawUseBox(Speedometer_Global[0], true);
TextDrawBoxColor(Speedometer_Global[0], 0x73B1EDFF);
TextDrawSetShadow(Speedometer_Global[0], 0);
TextDrawSetOutline(Speedometer_Global[0], 0);
TextDrawFont(Speedometer_Global[0], 0);
Speedometer_Global[1] = TextDrawCreate(601.500000, 395.666687, \"KM/H\");
TextDrawLetterSize(Speedometer_Global[1], 0.209998, 0.905833);
TextDrawAlignment(Speedometer_Global[1], 1);
TextDrawColor(Speedometer_Global[1], 0x73B1ED55);
TextDrawSetShadow(Speedometer_Global[1], 0);
TextDrawSetOutline(Speedometer_Global[1], 1);
TextDrawBackgroundColor(Speedometer_Global[1], 51);
TextDrawFont(Speedometer_Global[1], 1);
TextDrawSetProportional(Speedometer_Global[1], 1);
return true;
}
public OnPlayerConnect(playerid) {
IsSpeedometerVisible[playerid] = false;
for (new i = 0; i < 30; i++)
IsSpeedometerBarVisible[playerid] = false;
Speedometer_Player[playerid][0] = CreatePlayerTextDraw(playerid, 548.500000, 431.250030, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][0], 0.000000, -2.287029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][0], 546.000000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][0], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][0], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][0], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][0], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][0], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][0], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][0], 0);
Speedometer_Player[playerid][1] = CreatePlayerTextDraw(playerid, 551.000000, 431.250030, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][1], 0.000000, -2.287029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][1], 548.500000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][1], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][1], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][1], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][1], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][1], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][1], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][1], 0);
Speedometer_Player[playerid][2] = CreatePlayerTextDraw(playerid, 553.500000, 431.250030, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][2], 0.000000, -2.287029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][2], 551.000000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][2], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][2], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][2], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][2], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][2], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][2], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][2], 0);
Speedometer_Player[playerid][3] = CreatePlayerTextDraw(playerid, 556.000000, 431.250030, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][3], 0.000000, -2.287029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][3], 553.500000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][3], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][3], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][3], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][3], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][3], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][3], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][3], 0);
Speedometer_Player[playerid][4] = CreatePlayerTextDraw(playerid, 558.500000, 431.250030, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][4], 0.000000, -2.287029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][4], 556.000000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][4], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][4], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][4], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][4], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][4], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][4], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][4], 0);
Speedometer_Player[playerid][5] = CreatePlayerTextDraw(playerid, 561.000000, 431.250030, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][5], 0.000000, -2.287029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][5], 558.500000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][5], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][5], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][5], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][5], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][5], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][5], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][5], 0);
Speedometer_Player[playerid][6] = CreatePlayerTextDraw(playerid, 563.500000, 431.250030, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][6], 0.000000, -2.287029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][6], 561.000000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][6], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][6], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][6], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][6], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][6], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][6], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][6], 0);
Speedometer_Player[playerid][7] = CreatePlayerTextDraw(playerid, 566.000000, 431.250061, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][7], 0.000000, -2.287029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][7], 563.500000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][7], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][7], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][7], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][7], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][7], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][7], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][7], 0);
Speedometer_Player[playerid][8] = CreatePlayerTextDraw(playerid, 568.500000, 431.250000, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][8], 0.000000, -2.287029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][8], 566.000000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][8], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][8], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][8], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][8], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][8], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][8], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][8], 0);
Speedometer_Player[playerid][9] = CreatePlayerTextDraw(playerid, 571.000000, 431.250030, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][9], 0.000000, -2.287029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][9], 568.500000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][9], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][9], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][9], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][9], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][9], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][9], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][9], 0);
Speedometer_Player[playerid][10] = CreatePlayerTextDraw(playerid, 573.500000, 431.250061, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][10], 0.000000, -2.287029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][10], 571.000000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][10], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][10], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][10], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][10], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][10], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][10], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][10], 0);
Speedometer_Player[playerid][11] = CreatePlayerTextDraw(playerid, 576.000000, 431.250000, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][11], 0.000000, -2.287029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][11], 573.500000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][11], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][11], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][11], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][11], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][11], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][11], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][11], 0);
Speedometer_Player[playerid][12] = CreatePlayerTextDraw(playerid, 578.204971, 431.250000, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][12], 0.000000, -2.287029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][12], 575.704971, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][12], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][12], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][12], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][12], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][12], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][12], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][12], 0);
Speedometer_Player[playerid][13] = CreatePlayerTextDraw(playerid, 581.000000, 431.250061, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][13], 0.000000, -2.287029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][13], 578.500000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][13], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][13], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][13], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][13], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][13], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][13], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][13], 0);
Speedometer_Player[playerid][14] = CreatePlayerTextDraw(playerid, 583.500000, 431.250030, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][14], 0.000000, -2.287029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][14], 581.000000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][14], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][14], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][14], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][14], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][14], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][14], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][14], 0);
Speedometer_Player[playerid][15] = CreatePlayerTextDraw(playerid, 586.000000, 431.250061, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][15], 0.000000, -2.337028);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][15], 583.500000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][15], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][15], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][15], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][15], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][15], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][15], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][15], 0);
Speedometer_Player[playerid][16] = CreatePlayerTextDraw(playerid, 588.500000, 431.250030, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][16], 0.000000, -2.387027);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][16], 586.000000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][16], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][16], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][16], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][16], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][16], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][16], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][16], 0);
Speedometer_Player[playerid][17] = CreatePlayerTextDraw(playerid, 591.000000, 431.250061, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][17], 0.000000, -2.537029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][17], 588.500000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][17], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][17], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][17], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][17], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][17], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][17], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][17], 0);
Speedometer_Player[playerid][18] = CreatePlayerTextDraw(playerid, 593.500000, 431.250030, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][18], 0.000000, -2.637027);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][18], 591.000000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][18], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][18], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][18], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][18], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][18], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][18], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][18], 0);
Speedometer_Player[playerid][19] = CreatePlayerTextDraw(playerid, 596.000000, 431.250000, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][19], 0.000000, -2.787029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][19], 593.500000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][19], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][19], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][19], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][19], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][19], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][19], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][19], 0);
Speedometer_Player[playerid][20] = CreatePlayerTextDraw(playerid, 598.500000, 431.250000, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][20], 0.000000, -2.937027);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][20], 596.000000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][20], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][20], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][20], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][20], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][20], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][20], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][20], 0);
Speedometer_Player[playerid][21] = CreatePlayerTextDraw(playerid, 601.000000, 431.250061, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][21], 0.000000, -3.037029);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][21], 598.500000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][21], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][21], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][21], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][21], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][21], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][21], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][21], 0);
Speedometer_Player[playerid][22] = CreatePlayerTextDraw(playerid, 603.500000, 431.250000, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][22], 0.000000, -3.137027);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][22], 601.000000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][22], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][22], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][22], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][22], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][22], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][22], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][22], 0);
Speedometer_Player[playerid][23] = CreatePlayerTextDraw(playerid, 606.000000, 431.250061, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][23], 0.000000, -3.137027);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][23], 603.500000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][23], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][23], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][23], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][23], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][23], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][23], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][23], 0);
Speedometer_Player[playerid][24] = CreatePlayerTextDraw(playerid, 608.500000, 431.249938, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][24], 0.000000, -3.137027);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][24], 606.000000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][24], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][24], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][24], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][24], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][24], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][24], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][24], 0);
Speedometer_Player[playerid][25] = CreatePlayerTextDraw(playerid, 611.000000, 431.250000, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][25], 0.000000, -3.137027);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][25], 608.500000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][25], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][25], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][25], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][25], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][25], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][25], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][25], 0);
Speedometer_Player[playerid][26] = CreatePlayerTextDraw(playerid, 613.500000, 431.250000, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][26], 0.000000, -3.137027);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][26], 611.000000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][26], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][26], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][26], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][26], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][26], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][26], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][26], 0);
Speedometer_Player[playerid][27] = CreatePlayerTextDraw(playerid, 616.000000, 431.249969, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][27], 0.000000, -3.137027);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][27], 613.500000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][27], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][27], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][27], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][27], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][27], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][27], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][27], 0);
Speedometer_Player[playerid][28] = CreatePlayerTextDraw(playerid, 618.500000, 431.250061, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][28], 0.000000, -3.137027);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][28], 616.000000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][28], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][28], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][28], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][28], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][28], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][28], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][28], 0);
Speedometer_Player[playerid][29] = CreatePlayerTextDraw(playerid, 621.000000, 431.250061, \"usebox\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][29], 0.000000, -3.137027);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][29], 618.500000, 0.000000);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][29], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][29], 0);
PlayerTextDrawUseBox(playerid, Speedometer_Player[playerid][29], true);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][29], 102);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][29], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][29], 0);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][29], 0);
Speedometer_Player[playerid][30] = CreatePlayerTextDraw(playerid, 547.500000, 380.499938, \"0\");
PlayerTextDrawLetterSize(playerid, Speedometer_Player[playerid][30], 0.569999, 3.338332);
PlayerTextDrawTextSize(playerid, Speedometer_Player[playerid][30], 400.000000, 2.333331);
PlayerTextDrawAlignment(playerid, Speedometer_Player[playerid][30], 1);
PlayerTextDrawColor(playerid, Speedometer_Player[playerid][30], -1);
PlayerTextDrawSetShadow(playerid, Speedometer_Player[playerid][30], 0);
PlayerTextDrawSetOutline(playerid, Speedometer_Player[playerid][30], 1);
PlayerTextDrawBackgroundColor(playerid, Speedometer_Player[playerid][30], 0x73B1ED55);
PlayerTextDrawFont(playerid, Speedometer_Player[playerid][30], 2);
PlayerTextDrawSetProportional(playerid, Speedometer_Player[playerid][30], 1);
return true;
}
public OnPlayerUpdate(playerid) {
if (IsSpeedometerVisible[playerid]) {
new vehicleID, Float:position[3], Float:speed, string[12], bar, vehicle;
vehicleID = GetPlayerVehicleID(playerid);
GetVehicleVelocity(vehicleID, position[0], position[1], position[2]);
speed = floatsqroot(position[0]*position[0] + position[1]*position[1] + position[2]*position[2]) * 180;
format(string, 12, \"%.0f\", speed);
vehicle = GetVehicleModel(vehicleID) - 400;
PlayerTextDrawSetString(playerid, Speedometer_Player[playerid][30], string);
bar = floatround(speed / (VehicleData[vehicle][MaxSpeed] / 30.0), floatround_round);
if (bar > 30)
bar = 30;
if (bar != 0) {
IsSpeedometerBarVisible[playerid][bar-1] = true;
PlayerTextDrawHide(playerid, Speedometer_Player[playerid][bar-1]);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][bar-1], 0x73B1EDFF);
PlayerTextDrawShow(playerid, Speedometer_Player[playerid][bar-1]);
for (new i = bar-2; i != -1; i--) {
if (IsSpeedometerBarVisible[playerid])
break;
IsSpeedometerBarVisible[playerid] = true;
PlayerTextDrawHide(playerid, Speedometer_Player[playerid]);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid], 0x73B1EDFF);
PlayerTextDrawShow(playerid, Speedometer_Player[playerid]);
}
for (new i = bar; i < 30; i++) {
if (!IsSpeedometerBarVisible[playerid])
break;
IsSpeedometerBarVisible[playerid] = false;
PlayerTextDrawHide(playerid, Speedometer_Player[playerid]);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid], 102);
PlayerTextDrawShow(playerid, Speedometer_Player[playerid]);
}
}
else {
IsSpeedometerBarVisible[playerid][0] = false;
PlayerTextDrawHide(playerid, Speedometer_Player[playerid][0]);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid][0], 102);
PlayerTextDrawShow(playerid, Speedometer_Player[playerid][0]);
for (new i = 1; i < 30; i++) {
if (!IsSpeedometerBarVisible[playerid])
break;
IsSpeedometerBarVisible[playerid] = false;
PlayerTextDrawHide(playerid, Speedometer_Player[playerid]);
PlayerTextDrawBoxColor(playerid, Speedometer_Player[playerid], 102);
PlayerTextDrawShow(playerid, Speedometer_Player[playerid]);
}
}
}
return true;
}
public OnPlayerStateChange(playerid, newstate, oldstate) {
if (newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
ShowSpeedometer(playerid);
else
HideSpeedometer(playerid);
return true;
}
public ShowSpeedometer(playerid) {
IsSpeedometerVisible[playerid] = true;
TextDrawShowForPlayer(playerid, Speedometer_Global[0]);
TextDrawShowForPlayer(playerid, Speedometer_Global[1]);
for (new i = 0; i < 31; i++)
PlayerTextDrawShow(playerid, Speedometer_Player[playerid]);
return true;
}
public HideSpeedometer(playerid) {
IsSpeedometerVisible[playerid] = false;
TextDrawHideForPlayer(playerid, Speedometer_Global[0]);
TextDrawHideForPlayer(playerid, Speedometer_Global[1]);
PlayerTextDrawSetString(playerid, Speedometer_Player[playerid][30], \"0\");
for (new i = 0; i < 31; i++)
PlayerTextDrawHide(playerid, Speedometer_Player[playerid]);
return true;
}
Copy