Ich habe des jetzt so:
public VehStateCheck()
{
for(new playerid=0;playerid<MAX_PLAYERS;playerid++)
{
if(IsPlayerConnected(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && !IsANoTachoVehicle(GetPlayerVehicleID(playerid)))
{
if(M_Bot[playerid][PAFK] == 0)
{
new Text:Tacho[MAX_PLAYERS]; //14973 OProblemzeile 1 1. errors
new Float:health,vehicleid = GetPlayerVehicleID(playerid),string[256],Float:value,Float:distance,Float:x,Float:y,Float:z;
TextDrawHideForPlayer(playerid, Tacho[playerid]); //14975 OProblemzeile 1 4. errors
GetPlayerPos(playerid, x, y, z);
distance = floatsqroot(floatpower(floatabs(floatsub(x,PCarPos[playerid][PCarX])),2)+floatpower(floatabs(floatsub(y,PCarPos[playerid][PCarY])),2)+floatpower(floatabs(floatsub(z,PCarPos[playerid][PCarZ])),2));
value = floatround(distance * 11000);
GetVehicleHealth(vehicleid,health);
if (health >= 950 && health <= 1000)
{
format(string, sizeof(string), "~w~Geschwindigkeit: %d~w~ KM/H~n~Tankinhalt: ~w~%d ~b~/~w~ %d~w~~n~Zustand:~g~ |||||||||~n~~w~Fahrzeug: ~w~%s",floatround(value/1400),Gas[vehicleid],GetGasMax(GetVehicleModel(vehicleid)),VehicleName[GetVehicleModel(vehicleid)-400]);
Tacho[playerid] = TextDrawCreate(490.000000,401.000000,string);
TextDrawLetterSize(Tacho[playerid],0.299999,0.799999);
TextDrawSetOutline(Tacho[playerid],1);
TextDrawFont(Tacho[playerid],1);
TextDrawSetProportional(Tacho[playerid],1);
TextDrawAlignment(Tacho[playerid],0);
TextDrawBackgroundColor(Tacho[playerid],0x000000ff);
TextDrawColor(Tacho[playerid],0xffffffff);
TextDrawSetShadow(Tacho[playerid],1);
TextDrawShowForPlayer(playerid,Tacho[playerid]);
}
else if (health >= 900 && health <= 950)
{
format(string, sizeof(string), "~w~Geschwindigkeit: %d~w~ KM/H~n~Tankinhalt: ~w~%d ~b~/~w~ %d~w~~n~Zustand:~g~ |||||||||~n~~w~Fahrzeug: ~w~%s",floatround(value/1400),Gas[vehicleid],GetGasMax(GetVehicleModel(vehicleid)),VehicleName[GetVehicleModel(vehicleid)-400]);
Tacho[playerid] = TextDrawCreate(490.000000,401.000000,string);
TextDrawLetterSize(Tacho[playerid],0.299999,0.799999);
TextDrawSetOutline(Tacho[playerid],1);
TextDrawFont(Tacho[playerid],1);
TextDrawSetProportional(Tacho[playerid],1);
TextDrawAlignment(Tacho[playerid],0);
TextDrawBackgroundColor(Tacho[playerid],0x000000ff);
TextDrawColor(Tacho[playerid],0xffffffff);
TextDrawSetShadow(Tacho[playerid],1);
TextDrawShowForPlayer(playerid,Tacho[playerid]);
}
else if (health >= 700 && health <= 800)
{
format(string, sizeof(string), "~w~Geschwindigkeit: %d~w~ KM/H~n~Tankinhalt: ~w~%d ~b~/~w~ %d~w~~n~Zustand:~g~ ||||||||~n~~w~Fahrzeug: ~w~%s",floatround(value/1400),Gas[vehicleid],GetGasMax(GetVehicleModel(vehicleid)),VehicleName[GetVehicleModel(vehicleid)-400]);
Tacho[playerid] = TextDrawCreate(490.000000,401.000000,string);
TextDrawLetterSize(Tacho[playerid],0.299999,0.799999);
TextDrawSetOutline(Tacho[playerid],1);
TextDrawFont(Tacho[playerid],1);
TextDrawSetProportional(Tacho[playerid],1);
TextDrawAlignment(Tacho[playerid],0);
TextDrawBackgroundColor(Tacho[playerid],0x000000ff);
TextDrawColor(Tacho[playerid],0xffffffff);
TextDrawSetShadow(Tacho[playerid],1);
TextDrawShowForPlayer(playerid,Tacho[playerid]);
}
else if (health >= 600 && health <= 700)
{
format(string, sizeof(string), "~w~Geschwindigkeit: %d~w~ KM/H~n~Tankinhalt: ~w~%d ~b~/~w~ %d~w~~n~Zustand:~g~ |||||||~n~~w~Fahrzeug: ~w~%s",floatround(value/1400),Gas[vehicleid],GetGasMax(GetVehicleModel(vehicleid)),VehicleName[GetVehicleModel(vehicleid)-400]);
Tacho[playerid] = TextDrawCreate(490.000000,401.000000,string);
TextDrawLetterSize(Tacho[playerid],0.299999,0.799999);
TextDrawSetOutline(Tacho[playerid],1);
TextDrawFont(Tacho[playerid],1);
TextDrawSetProportional(Tacho[playerid],1);
TextDrawAlignment(Tacho[playerid],0);
TextDrawBackgroundColor(Tacho[playerid],0x000000ff);
TextDrawColor(Tacho[playerid],0xffffffff);
TextDrawSetShadow(Tacho[playerid],1);
TextDrawShowForPlayer(playerid,Tacho[playerid]);
}
else if (health >= 500 && health <= 600)
{
format(string, sizeof(string), "~w~Geschwindigkeit: %d~w~ KM/H~n~Tankinhalt: ~w~%d ~b~/~w~ %d~w~~n~Zustand:~g~ ||||||~n~~w~Fahrzeug: ~w~%s",floatround(value/1400),Gas[vehicleid],GetGasMax(GetVehicleModel(vehicleid)),VehicleName[GetVehicleModel(vehicleid)-400]);
Tacho[playerid] = TextDrawCreate(490.000000,401.000000,string);
TextDrawLetterSize(Tacho[playerid],0.299999,0.799999);
TextDrawSetOutline(Tacho[playerid],1);
TextDrawFont(Tacho[playerid],1);
TextDrawSetProportional(Tacho[playerid],1);
TextDrawAlignment(Tacho[playerid],0);
TextDrawBackgroundColor(Tacho[playerid],0x000000ff);
TextDrawColor(Tacho[playerid],0xffffffff);
TextDrawSetShadow(Tacho[playerid],1);
TextDrawShowForPlayer(playerid,Tacho[playerid]);
}
else if (health >= 400 && health <= 500)
{
format(string, sizeof(string), "~w~Geschwindigkeit: %d~w~ KM/H~n~Tankinhalt: ~w~%d ~b~/~w~ %d~w~~n~Zustand:~g~ |||||~n~~w~Fahrzeug: ~w~%s",floatround(value/1400),Gas[vehicleid],GetGasMax(GetVehicleModel(vehicleid)),VehicleName[GetVehicleModel(vehicleid)-400]);
Tacho[playerid] = TextDrawCreate(490.000000,401.000000,string);
TextDrawLetterSize(Tacho[playerid],0.299999,0.799999);
TextDrawSetOutline(Tacho[playerid],1);
TextDrawFont(Tacho[playerid],1);
TextDrawSetProportional(Tacho[playerid],1);
TextDrawAlignment(Tacho[playerid],0);
TextDrawBackgroundColor(Tacho[playerid],0x000000ff);
TextDrawColor(Tacho[playerid],0xffffffff);
TextDrawSetShadow(Tacho[playerid],1);
TextDrawShowForPlayer(playerid,Tacho[playerid]);
}
else if (health >= 300 && health <= 400)
{
format(string, sizeof(string), "~w~Geschwindigkeit: %d~w~ KM/H~n~Tankinhalt: ~w~%d ~b~/~w~ %d~w~~n~Zustand:~g~ ||||~n~~w~Fahrzeug: ~w~%s",floatround(value/1400),Gas[vehicleid],GetGasMax(GetVehicleModel(vehicleid)),VehicleName[GetVehicleModel(vehicleid)-400]);
Tacho[playerid] = TextDrawCreate(490.000000,401.000000,string);
TextDrawLetterSize(Tacho[playerid],0.299999,0.799999);
TextDrawSetOutline(Tacho[playerid],1);
TextDrawFont(Tacho[playerid],1);
TextDrawSetProportional(Tacho[playerid],1);
TextDrawAlignment(Tacho[playerid],0);
TextDrawBackgroundColor(Tacho[playerid],0x000000ff);
TextDrawColor(Tacho[playerid],0xffffffff);
TextDrawSetShadow(Tacho[playerid],1);
TextDrawShowForPlayer(playerid,Tacho[playerid]);
}
else if (health >= 200 && health <= 300)
{
format(string, sizeof(string), "~w~Geschwindigkeit: %d~w~ KM/H~n~Tankinhalt: ~w~%d ~b~/~w~ %d~w~~n~Zustand:~g~ |||~n~~w~Fahrzeug: ~w~%s",floatround(value/1400),Gas[vehicleid],GetGasMax(GetVehicleModel(vehicleid)),VehicleName[GetVehicleModel(vehicleid)-400]);
Tacho[playerid] = TextDrawCreate(490.000000,401.000000,string);
TextDrawLetterSize(Tacho[playerid],0.299999,0.799999);
TextDrawSetOutline(Tacho[playerid],1);
TextDrawFont(Tacho[playerid],1);
TextDrawSetProportional(Tacho[playerid],1);
TextDrawAlignment(Tacho[playerid],0);
TextDrawBackgroundColor(Tacho[playerid],0x000000ff);
TextDrawColor(Tacho[playerid],0xffffffff);
TextDrawSetShadow(Tacho[playerid],1);
TextDrawShowForPlayer(playerid,Tacho[playerid]);
}
else if (health >= 100 && health <= 200)
{
format(string, sizeof(string), "~w~Geschwindigkeit: %d~w~ KM/H~n~Tankinhalt: ~w~%d ~b~/~w~ %d~w~~n~Zustand:~g~ ||~n~~w~Fahrzeug: ~w~%s",floatround(value/1400),Gas[vehicleid],GetGasMax(GetVehicleModel(vehicleid)),VehicleName[GetVehicleModel(vehicleid)-400]);
Tacho[playerid] = TextDrawCreate(490.000000,401.000000,string);
TextDrawLetterSize(Tacho[playerid],0.299999,0.799999);
TextDrawSetOutline(Tacho[playerid],1);
TextDrawFont(Tacho[playerid],1);
TextDrawSetProportional(Tacho[playerid],1);
TextDrawAlignment(Tacho[playerid],0);
TextDrawBackgroundColor(Tacho[playerid],0x000000ff);
TextDrawColor(Tacho[playerid],0xffffffff);
TextDrawSetShadow(Tacho[playerid],1);
TextDrawShowForPlayer(playerid,Tacho[playerid]);
}
else if (health >= 0 && health <= 100)
{
format(string, sizeof(string), "~w~Geschwindigkeit: %d~w~ KM/H~n~Tankinhalt: ~w~%d ~b~/~w~ %d~w~~n~Zustand:~g~ |~n~~w~Fahrzeug: ~w~%s",floatround(value/1400),Gas[vehicleid],GetGasMax(GetVehicleModel(vehicleid)),VehicleName[GetVehicleModel(vehicleid)-400]);
Tacho[playerid] = TextDrawCreate(490.000000,401.000000,string);
TextDrawLetterSize(Tacho[playerid],0.299999,0.799999);
TextDrawSetOutline(Tacho[playerid],1);
TextDrawFont(Tacho[playerid],1);
TextDrawSetProportional(Tacho[playerid],1);
TextDrawAlignment(Tacho[playerid],0);
TextDrawBackgroundColor(Tacho[playerid],0x000000ff);
TextDrawColor(Tacho[playerid],0xffffffff);
TextDrawSetShadow(Tacho[playerid],1);
TextDrawShowForPlayer(playerid,Tacho[playerid]);
}
}
}
}
return 1;
}
Jedoch habe ich immernoch 5 errors:
[hide]C:\Users\Sven\Desktop\3c Client released\gamemodes\lyd.pwn(14973) : error 001: expected token: "-identifier-", but found "["
C:\Users\Sven\Desktop\3c Client released\gamemodes\lyd.pwn(14975) : error 029: invalid expression, assumed zero
C:\Users\Sven\Desktop\3c Client released\gamemodes\lyd.pwn(14975) : warning 215: expression has no effect
C:\Users\Sven\Desktop\3c Client released\gamemodes\lyd.pwn(14975) : error 001: expected token: ";", but found "]"
C:\Users\Sven\Desktop\3c Client released\gamemodes\lyd.pwn(14975) : error 029: invalid expression, assumed zero
C:\Users\Sven\Desktop\3c Client released\gamemodes\lyd.pwn(14975) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
[/hide]
//edit paar errors rausbekommen komplett neu geschrieben