Erklärt glaub ich alles...
Liegt an diesem Textdraw:
new KmHUpdateTimer[MAX_PLAYERS],
Text:Anzeige[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
Anzeige[playerid] = TextDrawCreate(634.000000, 425.000000, " ");
TextDrawAlignment(Anzeige[playerid], 3);
TextDrawBackgroundColor(Anzeige[playerid], 255);
TextDrawFont(Anzeige[playerid], 1);
TextDrawLetterSize(Anzeige[playerid], 0.539999, 1.100000);
TextDrawColor(Anzeige[playerid], -1);
TextDrawSetOutline(Anzeige[playerid], 0);
TextDrawSetProportional(Anzeige[playerid], 1);
TextDrawSetShadow(Anzeige[playerid], 1);
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_DRIVER)
{
TextDrawHideForPlayer(playerid,Anzeige[playerid]);
TextDrawSetString(Anzeige[playerid]," ");
KillTimer(KmHUpdateTimer[playerid]);
}
if(newstate == PLAYER_STATE_DRIVER)
{
TextDrawShowForPlayer(playerid,Anzeige[playerid]);
KmHUpdateTimer[playerid] = SetTimerEx("KmHUpdate",50,1,"u",playerid);
}
return 1;
}
forward KmHUpdate(playerid);
public KmHUpdate(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleTank(vehicleid) == 0)
{
format(String[0],sizeof String[0],"~n~~w~KM/h: %i",floatround(GetVehicleSpeed(vehicleid,0)));
}
else
{
format(String[0],sizeof(String[0]),"~w~Tank: ~g~Folgt~n~w~KM/h: %i",floatround(GetVehicleSpeed(vehicleid,0)));
}
TextDrawSetString(Anzeige[playerid],String[0]);
return 1;
}