13.07.2011, 02:59
Sorry .. I made a mistake.
#EDIT
Code fixed:
#EDIT
Code fixed:
PHP код:
forward VehicleTimer(playerid);
public VehicleTimer(playerid)
{
if(IsPlayerInAnyVehicle(playerid))
{
new healthstring[128];
new Float:health;
new vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid, health);
if(health >= 750 && health <= 1000) format(healthstring, sizeof(healthstring), "~w~Heatlh: ~g~h~%d", vehhealth);
else if(health >= 749 && health <= 500) format(healthstring, sizeof(healthstring), "~w~Health: ~y~~h~%d", vehhealth);
else if(health >= 250 && health <= 499) format(healthstring, sizeof(healthstring), "~w~Health: ~r~~h~%d", vehhealth);
else if(health >= 0 && health <= 249) format(healthstring, sizeof(healthstring), "~w~Health: ~r~~h~TOTALED");
TextDrawSetString(HealthText[playerid], healthstring);
new speedstring[128];
new kmh = GetPlayerSpeed(playerid, true);
if(kmh >= 0 && kmh <= 80) format(speedstring, sizeof(speedstring), "~w~Speed: ~g~~h~%d ~w~KM/h.", kmh);
else if(kmh >= 81 && kmh <= 120) format(speedstring, sizeof(speedstring), "~w~Speed: ~y~~h~%d ~w~KM/h.", kmh);
else if(kmh >= 121) format(speedstring, sizeof(speedstring), "~w~Speed: ~r~~h~%d ~w~KM/h.", kmh);
TextDrawSetString(SpeedoText[playerid], speedstring);
}
return 1;
}