Tach Leute, undzwar habe ich ein Tacho mit 100% ect.
Ich möchte gerne zehn solcher | haben wie z.b: ||||||||||
Bei 100% = |||||||||| Alle Weis
Bei 90% = ||||||||| Weiß | Rot und so weiter
Hier mein jetziger Code:
public Speedometer()
{
for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
{
if( IsPlayerConnected(playerid) )
{
if(IsPlayerInAnyVehicle(playerid) )
{
new Float:chealth, speed_string[255], kmh, vehicleid = GetPlayerVehicleID(playerid), modelid = GetVehicleModel(vehicleid);
GetVehicleHealth(vehicleid, chealth);
kmh = getKmh(playerid, true);
if( Tank[vehicleid] >= 5 )
{
if( Motor[vehicleid] == false )
{
format(speed_string,255,"~W~Fahrzeug: ~W~%s~n~~W~Km/h: ~W~%d km/h~n~~W~Zustand: ~W~%d%%~n~~W~Motor: ~R~Aus~n~~W~Benzin: ~g~%d~W~/%d", PlayerVehicle[modelid - 400], kmh, floatround(chealth, floatround_round)/10, Tank[vehicleid], MAXFULL);
}
else
{
format(speed_string,255,"~W~Fahrzeug: ~W~%s~n~~W~Km/h: ~W~%d km/h~n~~W~Zustand: ~W~%d%%~n~~W~Motor: ~G~An~n~~W~Benzin: ~W~%d~W~/%d", PlayerVehicle[modelid - 400], kmh, floatround(chealth, floatround_round)/10, Tank[vehicleid], MAXFULL);
}
}
else
{
if( Motor[vehicleid] == false )
{
format(speed_string,255,"~W~Fahrzeug: ~W~%s~n~~W~Km/h: ~W~%d km/h~n~~W~Zustand: ~W~%d%%~n~~W~Motor: ~R~Aus~n~~W~Benzin: ~g~%d~W~/%d", PlayerVehicle[modelid - 400], kmh, floatround(chealth, floatround_round)/10, Tank[vehicleid], MAXFULL);
}
else
{
format(speed_string,255,"~W~Fahrzeug: ~W~%s~n~~W~Km/h: ~W~%d km/h~n~~W~Zustand: ~W~%d%%~n~~W~Motor: ~G~An~n~~W~Benzin: ~W~%d~W~/%d", PlayerVehicle[modelid - 400], kmh, floatround(chealth, floatround_round)/10, Tank[vehicleid], MAXFULL);
}
}
TextDrawSetString(Tacho[playerid], speed_string);
TextDrawShowForPlayer(playerid, Tacho[playerid]);
TextDrawShowForPlayer(playerid, TTacho[playerid]);
TextDrawShowForPlayer(playerid, TBox[playerid]);
}
else
{
TextDrawHideForPlayer(playerid, Tacho[playerid]);
TextDrawHideForPlayer(playerid, TTacho[playerid]);
TextDrawHideForPlayer(playerid, TBox[playerid]);
}
}
}
return 1;
}
Mfg