I got a warning with that method.
Код:
if(IsPlayerInAnyVehicle(i) && Player[i][Speedo] == 1)
{
new string[50], color1[4], health, color2[4], vehid=GetPlayerVehicleID(i);
35906---------->GetVehicleHealth(vehid, health);
switch(GetPlayerSpeed(i, 0))
{
case 0 .. 40: color1 = "~w~";
case 41 .. 60: color1 = "~y~";
case 61 .. 200: color1 = "~r~";
default: color1 = "~w~";
}
switch(health)
{
case 0 .. 10: color2 = "~r~";
case 11 .. 50: color2 = "~y~";
case 51 .. 70: color2 = "~w~";
case 71 .. 100: color2 = "~g~";
default: color2 = "~w~";
}
format(string, sizeof(string), "~b~Car Health: %s%d", color2, health);
PlayerTextDrawSetString(i, CHTextDraw[i], string);
format(string, sizeof(string), "~b~MPH: %s%d", color1, GetPlayerSpeed(i, 0));
PlayerTextDrawSetString(i, SpeedTextDraw[i], string);
}
Код:
new string[50], color1[4], Float:health, color2[4], vehid=GetPlayerVehicleID(i);