stock UpdatePlayerTacho(playerid)
{
if(IsPlayerInAnyVehicle(playerid))
{
new string[128],
vehicleid,
model,
Float:CarHealth,
CarHealthIni,
Float:TankInProzent,
Float:Tank;
vehicleid = GetPlayerVehicleID(playerid);
model = GetVehicleModel(vehicleid);
//GetVehiclePos(vehicleid, Vehicle[vehicleid][vehPosX2], Vehicle[vehicleid][vehPosY2], Vehicle[vehicleid][vehPosZ2]);
if(IsAFahrrad(model))return 1;
TankInProzent = VehicleData[GetVehicleModel(vehicleid)-400][vehMaxTank]/100;
Tank = Vehicle[vehicleid][vehFuel];
GetVehicleHealth(vehicleid, CarHealth);
CarHealthIni = floatround((CarHealth - 250.0) / 7.5, floatround_floor);
if(CarHealthIni < 0) CarHealthIni = 0;
format(string, sizeof(string), "~b~%s: ~w~%d%", VehicleName[GetVehicleModel(vehicleid)-400],CarHealthIni);
PlayerTextDrawSetString(playerid, pTextSpeedo[playerid][3], string);
format(string, sizeof(string), "%d km/h", GetVehicleSpeed(vehicleid));
PlayerTextDrawSetString(playerid, pTextSpeedo[playerid][4], string);
format(string, sizeof(string), "~b~KM-Stand:~w~ %.1f", Vehicle[vehicleid][vehKMStand]);
PlayerTextDrawSetString(playerid, pTextSpeedo[playerid][2], string);
new Float:position = 514.0;
position += Tank/TankInProzent;
PlayerTextDrawTextSize(playerid, pTextSpeedo[playerid][1], position, 0.0);
if(Tank/TankInProzent >= 50 && Tank/TankInProzent <= 100){
PlayerTextDrawBoxColor(playerid, pTextSpeedo[playerid][1], 828254308);
}
if(Tank/TankInProzent <= 49 && Tank/TankInProzent >= 25){
PlayerTextDrawBoxColor(playerid, pTextSpeedo[playerid][1], -945203201);
}
if(Tank/TankInProzent >= 0 && Tank/TankInProzent <= 24){
PlayerTextDrawBoxColor(playerid, pTextSpeedo[playerid][1], -1625941249);
}
PlayerTextDrawShow(playerid, pTextSpeedo[playerid][1]);
format(string, sizeof(string), "~b~Tank: ~w~%d/%d ~b~L", floatround(Tank/TankInProzent));
PlayerTextDrawSetString(playerid, pTextSpeedo[playerid][1], string);
}
return 1;
}
Habe eine andere frage,
der Tank wird ja mit 100 L angezeigt. so aber ich möchte machen z.b 100.0/100 L
Wie mache ich das.
"Das ich jedes Auto einstellen kann wv Liter es haben soll