Hallo User,
Ich wollte mal die Zustands anzeige anders machen und zwar mit einem I was Rot, Gelb und Grün wird je nach zustand jedoch komme ich gerade nicht wirklich klar weil ich schon das für die Tank anzeige dort habe und nicht mit denn Klammern klar komme...
So habe ich das :))
public OnPlayerUpdate(playerid)
{
if(GetPlayerVehicleSeat(playerid) == 0)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
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
{
TextDrawSetString(pSpeedo[playerid][2], "~w~Tank: ~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I~g~I ");
}
{
new string[125];
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);
}
}
else
{
TextDrawSetString(pSpeedo[playerid][3], "~w~Zustand:~g~I");
}
return 1;
}
aber so kommen Errors:
Bread.pwn(896) : warning 217: loose indentation
Bread.pwn(898) : error 017: undefined symbol "Zustand"
Bread.pwn(898) : error 017: undefined symbol "vehicleid"
Bread.pwn(898) : error 029: invalid expression, assumed zero
Bread.pwn(898) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.