Hi,
ich habe ein Problem mit den Speed den es zeigt 0.000000 an und nich 0 siehe screen
Code: public TachoUpdate(i)
{
new playerid=i;
new State = GetPlayerState(playerid);
if(State == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
new VehicleModel = GetVehicleModel(vehicleid);
new Float:heal, Float:Speed, Float:health;
new string[512], Sspeed[512], Float:panzerung;
GetVehicleSpeed(vehicleid, Speed);
GetVehicleHealth(GetPlayerVehicleID(playerid), heal);
format(Sspeed,sizeof(Sspeed),"%0.fkm/h",Speed);
format(string,sizeof(string),"%s" ,VehiclesName[GetVehicleModel(vehicleid)-400]);
panzerung=floatsub(heal,5000);
TextDrawSetString(Textdraw17[playerid], string);
TextDrawSetString(Textdraw18[playerid], Sspeed);
if(heal>5001)
{
SetProgressBarValue(PanzerBar[playerid], panzerung);
SetProgressBarValue(HealthBar[playerid], 5000);
UpdateProgressBar(PanzerBar[playerid],playerid);
UpdateProgressBar(HealthBar[playerid],playerid);
}
else
{
SetProgressBarValue(HealthBar[playerid], heal);
SetProgressBarValue(PanzerBar[playerid], 0);
UpdateProgressBar(PanzerBar[playerid],playerid);
UpdateProgressBar(HealthBar[playerid],playerid);
}
TextDrawShowForPlayer(playerid, Textdraw18[playerid]);
TextDrawShowForPlayer(playerid, Textdraw17[playerid]);
UpdateProgressBar(PanzerBar[playerid], playerid);
UpdateProgressBar(HealthBar[playerid], playerid);
}
else
{
TextDrawHideForPlayer(playerid,Textdraw18[playerid]);
TextDrawHideForPlayer(playerid,Textdraw17[playerid]);
HideProgressBarForPlayer(playerid, HealthBar[playerid]);
HideProgressBarForPlayer(playerid, PanzerBar[playerid]);
}
return 1;
}