Hi wenn ich Tacho über OnPlayerUpdate laufen lasse, funktioniert er garnichtmehr...
public OnPlayerUpdate(playerid)
{
Tachometer();
return 1;
}
stock Tachometer()
{
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,"~B~Fahrzeug: ~W~%s~n~~B~Km/h: ~W~%d km/h~n~~B~Zustand: ~W~%d%%~n~~B~Motor: ~R~Aus~n~~B~Benzin: ~g~%d~W~/%d", PlayerVehicle[modelid - 400], kmh, floatround(chealth, floatround_round)/10, Tank[vehicleid], MAXFULL);
}
else
{
format(speed_string,255,"~B~Fahrzeug: ~W~%s~n~~B~Km/h: ~W~%d km/h~n~~B~Zustand: ~W~%d%%~n~~B~Motor: ~G~An~n~~B~Benzin: ~g~%d~W~/%d", PlayerVehicle[modelid - 400], kmh, floatround(chealth, floatround_round)/10, Tank[vehicleid], MAXFULL);
}
}
else
{
if ( Motor[vehicleid] == false )
{
format(speed_string,255,"~B~Fahrzeug: ~W~%s~n~~B~Km/h: ~W~%d km/h~n~~B~Zustand: ~W~%d%%~n~~B~Motor: ~R~Aus~n~~B~Benzin: ~r~%d~W~/%d", PlayerVehicle[modelid - 400], kmh, floatround(chealth, floatround_round)/10, Tank[vehicleid], MAXFULL);
}
else
{
format(speed_string,255,"~B~Fahrzeug: ~W~%s~n~~B~Km/h: ~W~%d km/h~n~~B~Zustand: ~W~%d%%~n~~B~Motor: ~G~An~n~~B~Benzin: ~r~%d~W~/%d", PlayerVehicle[modelid - 400], kmh, floatround(chealth, floatround_round)/10, Tank[vehicleid], MAXFULL);
}
}
TextDrawSetString(Tacho[playerid], speed_string);
}
else
{
TextDrawHideForPlayer(playerid, Tacho[playerid]);
}
}
}
return 1;
}