Nochmal Tacho Problem

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hallo Community,


    Habe schon wieder ein Problem mit dem Tacho system
    Bei TachoUpdate kommen jetzt warnings


    public TachoUpdate(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    if(IsPlayerInAnyVehicle(playerid))
    {
    TextDrawShowForPlayer(playerid,TBox); //Hier
    format(_str,256,"~r~Tempo: ~w~%d km/h",GetVehicleSpeed(GetPlayerVehicleID(playerid)));
    TextDrawSetString(Tempo,_str);//Hier
    TextDrawShowForPlayer(playerid,Tempo);//Hier


    format(_str,256,"~r~Model: ~w~%s",carNamen[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
    TextDrawSetString(Model,_str);//Hier
    TextDrawShowForPlayer(playerid,Model);//Hier


    new Float:vHealth;
    new string[126];
    GetVehicleHealth(GetPlayerVehicleID(playerid),vHealth);
    if(vHealth >= 999.0)
    {
    format(string, sizeof(string), "~g~Schaden:~g~%.1f", vHealth);
    TextDrawSetString(Schaden,string);//Hier
    TextDrawShowForPlayer(playerid,Schaden);//Hier
    }
    else if(vHealth >= 750.0 && vHealth < 999.0)
    {
    format(string, sizeof(string), "~g~Schaden:~g~%.1f", vHealth);
    TextDrawSetString(Schaden,string);//Hier
    TextDrawShowForPlayer(playerid,Schaden);//Hier
    }
    else if(vHealth >= 375.0 && vHealth < 750.0)
    {
    format(string, sizeof(string), "~g~Schaden:~y~%.1f", vHealth);
    TextDrawSetString(Schaden,string);//Hier
    TextDrawShowForPlayer(playerid,Schaden);//Hier
    }
    else if(vHealth < 375.0)
    {
    format(string, sizeof(string), "~g~Schaden:~r~%.1f", vHealth);
    TextDrawSetString(Schaden,string);//Hier
    TextDrawShowForPlayer(playerid,Schaden);//Hier
    }
    }
    else
    {
    TextDrawHideForPlayer(playerid,TBox);//Hier
    TextDrawHideForPlayer(playerid,Tempo);//Hier
    TextDrawHideForPlayer(playerid,Model);//Hier
    TextDrawHideForPlayer(playerid,Schaden);//Hier
    TextDrawHideForPlayer(playerid,Tankl);//Hier
    }
    }
    return 1;
    }

    test.p(7124) : warning 213: tag mismatch
    test.p(7126) : warning 213: tag mismatch
    test.p(7127) : warning 213: tag mismatch
    test.p(7130) : warning 213: tag mismatch
    test.p(7131) : warning 213: tag mismatch
    test.p(7139) : warning 213: tag mismatch
    test.p(7140) : warning 213: tag mismatch
    test.p(7145) : warning 213: tag mismatch
    test.p(7146) : warning 213: tag mismatch
    test.p(7151) : warning 213: tag mismatch
    test.p(7152) : warning 213: tag mismatch
    test.p(7157) : warning 213: tag mismatch
    test.p(7158) : warning 213: tag mismatch
    test.p(7163) : warning 213: tag mismatch
    test.p(7164) : warning 213: tag mismatch
    test.p(7165) : warning 213: tag mismatch
    test.p(7166) : warning 213: tag mismatch
    test.p(7167) : warning 213: tag mismatch


    Hoffe mir kann einer Helfen :)

  • Du musst die variablen auch immer mit Text: kennzeichnen beim deklarieren.
    Sprich, zum Beispiel so:


    new Text:TBox;

  • Das habe ich ja
    new PlayerText:TBox;
    new PlayerText:Tempo;
    new PlayerText:Model;
    new PlayerText:Schaden;
    new PlayerText:Tankl;


    Jeffry meinte ich soll das tacho in CreatePlayerTextDraw umwandeln was ich gemacht habe aber ich habe es im Tachoupdate vergessen

  • new PlayerText:TBox;
    new PlayerText:Tempo;
    new PlayerText:Model;
    new PlayerText:Schaden;
    new PlayerText:Tankl;


    zu


    new PlayerText:TBox[MAX_PLAYERS];
    new PlayerText:Tempo[MAX_PLAYERS];
    new PlayerText:Model[MAX_PLAYERS];
    new PlayerText:Schaden[MAX_PLAYERS];
    new PlayerText:Tankl[MAX_PLAYERS];


    und:


    public TachoUpdate(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    if(IsPlayerInAnyVehicle(playerid))
    {
    PlayerTextDrawShow(playerid,TBox[playerid]); //Hier
    format(_str,256,"~r~Tempo: ~w~%d km/h",GetVehicleSpeed(GetPlayerVehicleID(playerid)));
    PlayerTextDrawSetString(playerid,Tempo[playerid],_str);//Hier
    PlayerTextDrawShow(playerid,Tempo[playerid]);//Hier


    format(_str,256,"~r~Model: ~w~%s",carNamen[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
    PlayerTextDrawSetString(playerid,Model[playerid],_str);//Hier
    PlayerTextDrawShow(playerid,Model[playerid]);//Hier


    new Float:vHealth;
    new string[126];
    GetVehicleHealth(GetPlayerVehicleID(playerid),vHealth);
    if(vHealth >= 999.0)
    {
    format(string, sizeof(string), "~g~Schaden:~g~%.1f", vHealth);
    PlayerTextDrawSetString(playerid,Schaden[playerid],string);//Hier
    PlayerTextDrawShow(playerid,Schaden[playerid]);//Hier
    }
    else if(vHealth >= 750.0 && vHealth < 999.0)
    {
    format(string, sizeof(string), "~g~Schaden:~g~%.1f", vHealth);
    PlayerTextDrawSetString(playerid,Schaden[playerid],string);//Hier
    PlayerTextDrawShow(playerid,Schaden[playerid]);//Hier
    }
    else if(vHealth >= 375.0 && vHealth < 750.0)
    {
    format(string, sizeof(string), "~g~Schaden:~y~%.1f", vHealth);
    PlayerTextDrawSetString(playerid,Schaden[playerid],string);//Hier
    PlayerTextDrawShow(playerid,Schaden[playerid]);//Hier
    }
    else if(vHealth < 375.0)
    {
    format(string, sizeof(string), "~g~Schaden:~r~%.1f", vHealth);
    PlayerTextDrawSetString(playerid,Schaden[playerid],string);//Hier
    PlayerTextDrawShow(playerid,Schaden[playerid]);//Hier
    }
    }
    else
    {
    PlayerTextDrawHide(playerid,TBox[playerid]);//Hier
    PlayerTextDrawHide(playerid,Tempo[playerid]);//Hier
    PlayerTextDrawHide(playerid,Model[playerid]);//Hier
    PlayerTextDrawHide(playerid,Schaden[playerid]);//Hier
    PlayerTextDrawHide(playerid,Tankl[playerid]);//Hier
    }
    }
    return 1;
    }