dein Code ist ja mal sehr durcheinander
Teste mal das hier:
public OnPlayerUpdate(playerid)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
if(GetPlayerVehicleSeat(playerid) == 0)
{
if(GetVehicleModel(vehicleid) != 509 && GetVehicleModel(vehicleid) != 481 && GetVehicleModel(vehicleid) != 510)
{
new string[125];
if(Tank[vehicleid] <= 0) format(string,sizeof string,"~g~Tank: ~r~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 5)
{
format(string,sizeof string,"~w~Tank: ~y~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I",Tank[vehicleid]);
PlayerPlaySound(playerid, 1085, 0.0,0.0,10.0);
}
else if(Tank[vehicleid] <= 10)
{
format(string,sizeof string,"~w~Tank: ~g~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I",Tank[vehicleid]);
PlayerPlaySound(playerid, 1085, 0.0,0.0,10.0);
}
else if(Tank[vehicleid] <= 15) format(string,sizeof string,"~w~Tank: ~g~I~y~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 20) format(string,sizeof string,"~w~Tank: ~g~I~g~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 25) format(string,sizeof string,"~w~Tank: ~g~I~g~I~y~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 30) format(string,sizeof string,"~w~Tank: ~g~I~g~I~g~I~r~I~r~I~r~I~r~I~r~I~r~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 35) format(string,sizeof string,"~w~Tank: ~g~I~g~I~g~I~y~I~r~I~r~I~r~I~r~I~r~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 40) format(string,sizeof string,"~w~Tank: ~g~I~g~I~g~I~g~I~r~I~r~I~r~I~r~I~r~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 45) format(string,sizeof string,"~w~Tank: ~g~I~g~I~g~I~g~I~y~I~r~I~r~I~r~I~r~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 50) format(string,sizeof string,"~w~Tank: ~g~I~g~I~g~I~g~I~g~I~r~I~r~I~r~I~r~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 55) format(string,sizeof string,"~w~Tank: ~g~I~g~I~g~I~g~I~g~I~y~I~r~I~r~I~r~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 60) format(string,sizeof string,"~w~Tank: ~g~I~g~I~g~I~g~I~g~I~g~I~r~I~r~I~r~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 65) format(string,sizeof string,"~w~Tank: ~g~I~g~I~g~I~g~I~g~I~g~I~y~I~r~I~r~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 70) format(string,sizeof string,"~w~Tank: ~g~I~g~I~g~I~g~I~g~I~g~I~g~I~r~I~r~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 75) format(string,sizeof string,"~w~Tank: ~g~I~g~I~g~I~g~I~g~I~g~I~g~I~y~I~r~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 80) format(string,sizeof string,"~w~Tank: ~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I~r~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 85) format(string,sizeof string,"~w~Tank: ~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I~y~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 90) format(string,sizeof string,"~w~Tank: ~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I~r~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 95) format(string,sizeof string,"~w~Tank: ~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I~y~I",Tank[vehicleid]);
else if(Tank[vehicleid] <= 100) format(string,sizeof string,"~w~Tank: ~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I",Tank[vehicleid]);
TextDrawSetString(pSpeedo[playerid][2],string);
}
else
{
new string[125], Zustand[MAX_VEHICLES];
GetVehicleHealth(vehicleid,Zustand[vehicleid])
if(Zustand[vehicleid] <= 0) format(string,sizeof string,"~w~Zustand:~r~I",Zustand[vehicleid]);
else if(Zustand[vehicleid] <= 250)
{
format(string,sizeof string,"~w~Zustand:~r~I",Zustand[vehicleid]);
}
else if(Tank[vehicleid] <= 500) { format(string,sizeof string,"~w~Zustand:~y~I",Zustand[vehicleid]); }
else if(Tank[vehicleid] <= 1000) { format(string,sizeof string,"~w~Zustand:~g~I",Zustand[vehicleid]); }
TextDrawSetString(pSpeedo[playerid][3],string);
}
}
TextDrawSetString(pSpeedo[playerid][3], "~w~Zustand:~g~I");
return 1;
}
Ausserdem empfehle ich dir anstatt OnPlayerUpdate mit einem Timer zu arbeiten.