Wieso speichert string nicht in var?

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
  • Wieso klappt das so nicht?


    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(engine == VEHICLE_PARAMS_ON)
    {
    motor="~g~An";
    }
    if(engine == VEHICLE_PARAMS_OFF)
    {
    motor="~r~Aus";
    }
    if(lights == VEHICLE_PARAMS_ON)
    {
    tacholicht="~g~An";
    }
    if(lights == VEHICLE_PARAMS_OFF)
    {
    tacholicht="~r~Aus";
    }
    format(str2,sizeof(str2),"Motor: %s",strval(motor));
    format(str3,sizeof(str3),"Licht: %s",strval(tacholicht));


    Wieso seh ich da nicht ob das licht an oder aus ist?

  • Wenn du uns code zeigst


    Unter OnPlayerUpdate
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {


    new string[128],str1[128],str2[128],str3[128],motor[128],tacholicht[128];
    new engine,lights,alarm,doors,bonnet,boot,objective;
    new speed = ErmittleGeschwindigkeit(playerid,true);
    new vehicleid = GetPlayerVehicleID(playerid);
    new Float:CarHealth;
    GetVehicleHealth(vehicleid,CarHealth);
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(engine == VEHICLE_PARAMS_ON)
    {
    motor="~g~An";
    }
    if(engine == VEHICLE_PARAMS_OFF)
    {
    motor="~r~Aus";
    }
    if(lights == VEHICLE_PARAMS_ON)
    {
    tacholicht="~g~An";
    }
    if(lights == VEHICLE_PARAMS_OFF)
    {
    tacholicht="~r~Aus";
    }
    format(string, sizeof(string), "~b~KM/H: ~w~%d",speed);
    format(str1,sizeof(str1),"~w~Tank: ~g~%d~w~/~r~%d ~w~Liter",Gas[vehicleid],GetGasMax(GetVehicleModel(vehicleid)));
    format(str2,sizeof(str2),"~w~Motor: %s",motor);
    format(str3,sizeof(str3),"~w~Licht: %s",tacholicht);
    PlayerTextDrawSetString(playerid, Tacho1[playerid], string);
    PlayerTextDrawSetString(playerid, Tacho2[playerid], str1);//Tank
    PlayerTextDrawSetString(playerid, Tacho3[playerid], str2);//Motor
    PlayerTextDrawSetString(playerid, Tacho4[playerid], str3);//Licht
    PlayerTextDrawShow(playerid,Tacho1[playerid]);
    PlayerTextDrawShow(playerid,Tacho2[playerid]);
    PlayerTextDrawShow(playerid,Tacho3[playerid]);
    PlayerTextDrawShow(playerid,Tacho4[playerid]);
    PlayerTextDrawShow(playerid,Tacho0[playerid]);
    PlayerTextDrawShow(playerid,Tacho5[playerid]);
    }
    OnPlayerState
    if(newstate == PLAYER_STATE_DRIVER)
    {
    PlayerTextDrawHide(playerid,Tacho1[playerid]);
    PlayerTextDrawShow(playerid,Tacho1[playerid]);
    PlayerTextDrawHide(playerid,Tacho0[playerid]);
    PlayerTextDrawShow(playerid,Tacho0[playerid]);
    PlayerTextDrawHide(playerid,Tacho5[playerid]);
    PlayerTextDrawShow(playerid,Tacho5[playerid]);
    PlayerTextDrawHide(playerid,Tacho2[playerid]);
    PlayerTextDrawShow(playerid,Tacho2[playerid]);
    PlayerTextDrawHide(playerid,Tacho3[playerid]);
    PlayerTextDrawShow(playerid,Tacho3[playerid]);
    PlayerTextDrawHide(playerid,Tacho4[playerid]);
    PlayerTextDrawShow(playerid,Tacho4[playerid]);
    PlayerTextDrawShow(playerid,Tacho4[playerid]);
    PlayerTextDrawShow(playerid,Tacho3[playerid]);
    }