Das ist Timer für das Tacho...
Function Timer4(){
new fahrzeugname[40];
ForEachPlayer(playerid){
printf("Called Playerid: %i", playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER){
printf("PlayerID: %i ist Fahrer", playerid);
if(GetPVarInt(playerid, "TachoShown") != 1){
printf("PlayerID: %i Tacho wird angezeigt", playerid);
SetPVarInt(playerid, "TachoShown", 1);
/*format(fahrzeugname, sizeof(fahrzeugname), "%s", VehicleName[GetVehicleModel(GetPlayerVehicleID(playerid))]);
PlayerTextDrawSetString(playerid, TachoDraw[playerid][1], fahrzeugname);*/
PlayerTextDrawShow(playerid, TachoDraw[playerid][0]);
print("TachoDraw 1");
PlayerTextDrawShow(playerid, TachoDraw[playerid][1]);
print("TachoDraw 2");
PlayerTextDrawShow(playerid, TachoDraw[playerid][2]);
print("TachoDraw 3");
PlayerTextDrawShow(playerid, TachoDraw[playerid][3]);
print("TachoDraw 4");
}
new string[128], zustand[15], Float:vHP;
new debugstep;
printf("Debug: %i", debugstep);
debugstep ++;
GetVehicleHealth(GetPlayerVehicleID(playerid), vHP);
printf("Debug: %i", debugstep);
debugstep ++;
if(vHP > 970)zustand="~g~Sehr Gut";
else if(vHP > 600 && vHP < 970)zustand="~g~Gut";
else if(vHP > 400 && vHP < 600)zustand="~y~In Ordnung";
else if(vHP > 0 && vHP < 400)zustand="~r~Schlecht";
printf("Debug: %i", debugstep);
debugstep ++;
format(string, sizeof(string), "~w~KM/H: ~y~%i~n~~w~Zustand: %s~n~~w~Tank: ~g~%i~w~/%i Liter", getPlayerSpeed(playerid), zustand, Gas[GetPlayerVehicleID(playerid)],GasMax[GetVehicleModel(GetPlayerVehicleID(playerid))]);
printf("Debug: %i", debugstep);
debugstep ++;
PlayerTextDrawSetString(playerid, TachoDraw[playerid][2], string);
printf("Debug: %i", debugstep);
debugstep ++;
}
else{
if(GetPVarInt(playerid, "TachoShown") != 0){
for(new i=0;i<4;i++)PlayerTextDrawHide(playerid, TachoDraw[playerid][i]);
DeletePVar(playerid, "TachoShown");
printf("PlayerID: %i Tacho wird ausgeblendet", playerid);
}
}
}
return 1;
}
Und das ist die Serverlog
ZitatAlles anzeigen[20:00:20] Called Playerid: 1
[20:00:21] Called Playerid: 1
[20:00:21] Called Playerid: 1
[20:00:22] Called Playerid: 1
[20:00:22] [GNR]SkillerZ has logged in.
[20:00:22] Called Playerid: 1
[20:00:23] Called Playerid: 1
[20:00:24] Called Playerid: 1
[20:00:24] Called Playerid: 1
[20:00:25] Called Playerid: 1
[20:00:25] Called Playerid: 1
[20:00:26] Called Playerid: 1
[20:00:26] Called Playerid: 1
[20:00:27] Called Playerid: 1
[20:00:27] Called Playerid: 1
[20:00:28] Called Playerid: 1
[20:00:28] Called Playerid: 1
[20:00:29] Called Playerid: 1
[20:00:30] Called Playerid: 1
[20:00:30] Called Playerid: 1
[20:00:31] Called Playerid: 1
[20:00:31] Called Playerid: 1
[20:00:32] Called Playerid: 1
[20:00:32] Called Playerid: 1
[20:00:33] Called Playerid: 1
[20:00:33] Auto mit der ID 514 hergestellt.
[20:00:33] Called Playerid: 1
[20:00:33] PlayerID: 1 ist Fahrer
[20:00:33] PlayerID: 1 Tacho wird angezeigt
[20:00:33] TachoDraw 1
[20:00:33] TachoDraw 2
[20:00:33] TachoDraw 3
[20:00:33] TachoDraw 4
[20:00:33] Debug: 0
[20:00:33] Debug: 1
[20:00:33] Debug: 2
[20:00:34] Called Playerid: 1
[20:00:34] PlayerID: 1 ist Fahrer
[20:00:34] Debug: 0
[20:00:34] Debug: 1
[20:00:34] Debug: 2
[20:00:34] Called Playerid: 1
[20:00:34] PlayerID: 1 ist Fahrer
[20:00:34] Debug: 0
[20:00:34] Debug: 1
[20:00:34] Debug: 2
[20:00:35] Called Playerid: 1
[20:00:35] PlayerID: 1 Tacho wird ausgeblendet
[20:00:36] Called Playerid: 1
[20:00:36] Called Playerid: 1
[20:00:37] Called Playerid: 1
[20:00:37] Called Playerid: 1
[20:00:38] Called Playerid: 1
[20:00:38] PlayerID: 1 ist Fahrer
[20:00:38] PlayerID: 1 Tacho wird angezeigt
[20:00:38] TachoDraw 1
[20:00:38] TachoDraw 2
[20:00:38] TachoDraw 3
[20:00:38] TachoDraw 4
[20:00:38] Debug: 0
[20:00:38] Debug: 1
[20:00:38] Debug: 2
[20:00:38] Called Playerid: 1
[20:00:38] PlayerID: 1 ist Fahrer
[20:00:38] Debug: 0
[20:00:38] Debug: 1
[20:00:38] Debug: 2
[20:00:39] Called Playerid: 1
[20:00:39] PlayerID: 1 ist Fahrer
[20:00:39] Debug: 0
[20:00:39] Debug: 1
[20:00:39] Debug: 2
[20:00:39] Called Playerid: 1
[20:00:39] PlayerID: 1 ist Fahrer
[20:00:39] Debug: 0
[20:00:39] Debug: 1
[20:00:39] Debug: 2
[20:00:40] Called Playerid: 1
[20:00:40] PlayerID: 1 Tacho wird ausgeblendet
[20:00:40] Called Playerid: 1
[20:00:41] Called Playerid: 1
[20:00:42] Called Playerid: 1
[20:00:42] Called Playerid: 1
[20:00:43] Called Playerid: 1
[20:00:43] Called Playerid: 1
[20:00:44] Called Playerid: 1
[20:00:44] Called Playerid: 1
[20:00:45] Called Playerid: 1
[20:00:45] Called Playerid: 1