Car Edit System Fehler

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 liebe Community,
    ich habe folgendes Problem und zwar hab ich ein caredit System Geschrieben womit ich Farbe,Besitzer und (Löschen) ändern kann.
    Das Problem er Speichert bzw läd die neue Farbe nicht ich finde aber auch nicht den Fehler.


    Hier mal die Codes:


    ocmd:caredit(playerid,params[])
    {
    if(sInfo[playerid][Adminlevel]>=ADMIN_HIGH_ADMIN)
    {
    if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,rot,"Du bist in keinem Fahrzeug!");
    if(GetPVarInt(playerid,"CarEdit")==0)
    {
    SetPVarInt(playerid,"CarEdit",1);
    PlayerTextDrawShow(playerid,carlabel_background[playerid]);
    PlayerTextDrawShow(playerid,carlabel_heading[playerid]);
    PlayerTextDrawShow(playerid,carlabel_owner[playerid]);
    PlayerTextDrawShow(playerid,carlabel_color[playerid]);
    PlayerTextDrawShow(playerid,carlabel_delete[playerid]);
    SelectTextDraw(playerid,blau);
    return 1;
    }
    else
    if(GetPVarInt(playerid,"CarEdit")==1)
    {
    SetPVarInt(playerid,"CarEdit",0);
    new vID = GetPlayerVehicleID(playerid);
    for(new i=0; i<sizeof(vInfo); i++)
    {
    if(vInfo[i][v_id_x]!=vID)continue;
    new vdbid = vInfo[i][v_db_id];
    new string[64];
    format(string,sizeof string,"/autos/car %i.txt",vInfo[i][v_db_id]);
    DestroyVehicle(vInfo[i][v_id_x]);
    vInfo[i][v_id_x]=0;
    SaveCar(vID);
    LoadCar(vdbid);
    PlayerTextDrawHide(playerid,carlabel_background[playerid]);
    PlayerTextDrawHide(playerid,carlabel_heading[playerid]);
    PlayerTextDrawHide(playerid,carlabel_owner[playerid]);
    PlayerTextDrawHide(playerid,carlabel_color[playerid]);
    PlayerTextDrawHide(playerid,carlabel_delete[playerid]);
    return 1;
    }
    return 1;
    }
    }else{
    SendClientMessage(playerid,rot,"Du darfst diesen Befhel nicht nutzen!");
    }
    return 1;
    }


    public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
    {
    if(playertextid == carlabel_color[playerid])
    {
    ShowPlayerDialog(playerid,DIALOG_EDIT_CAR_COLOR,DIALOG_STYLE_INPUT,"Fabre aendern","Bitte gib Farbe 1 an\nVon 0-255","Abbrechen","Weiter");
    PlayerTextDrawHide(playerid,carlabel_background[playerid]);
    PlayerTextDrawHide(playerid,carlabel_heading[playerid]);
    PlayerTextDrawHide(playerid,carlabel_owner[playerid]);
    PlayerTextDrawHide(playerid,carlabel_color[playerid]);
    PlayerTextDrawHide(playerid,carlabel_delete[playerid]);
    CancelSelectTextDraw(playerid);
    }
    return 1;
    }


    SaveCar(vID)
    {
    for(new i=0; i<sizeof(vInfo); i++)
    {
    if(vInfo[i][v_id_x]!=vID)continue;
    new string[64];
    format(string,sizeof string,"/autos/car %i.txt",vInfo[i][v_db_id]);
    new color1,color2;
    GetVehicleColor(vInfo[i][v_id_x], color1,color2);
    vInfo[i][v_color_1]=color1;
    vInfo[i][v_color_2]=color2;
    vInfo[i][v_spoiler]=GetVehicleComponentInSlot(vInfo[i][v_id_x],0);
    vInfo[i][v_hood]=GetVehicleComponentInSlot(vInfo[i][v_id_x],1);
    vInfo[i][v_roof]=GetVehicleComponentInSlot(vInfo[i][v_id_x],2);
    vInfo[i][v_sideskirt]=GetVehicleComponentInSlot(vInfo[i][v_id_x],3);
    vInfo[i][v_lamps]=GetVehicleComponentInSlot(vInfo[i][v_id_x],4);
    vInfo[i][v_nitro]=GetVehicleComponentInSlot(vInfo[i][v_id_x],5);
    vInfo[i][v_exhaust]=GetVehicleComponentInSlot(vInfo[i][v_id_x],6);
    vInfo[i][v_wheels]=GetVehicleComponentInSlot(vInfo[i][v_id_x],7);
    vInfo[i][v_stereo]=GetVehicleComponentInSlot(vInfo[i][v_id_x],8);
    vInfo[i][v_hydraulics]=GetVehicleComponentInSlot(vInfo[i][v_id_x],9);
    vInfo[i][v_front_bumper]=GetVehicleComponentInSlot(vInfo[i][v_id_x],10);
    vInfo[i][v_rear_bumper]=GetVehicleComponentInSlot(vInfo[i][v_id_x],11);
    vInfo[i][v_vent_left]=GetVehicleComponentInSlot(vInfo[i][v_id_x],12);
    vInfo[i][v_vent_right]=GetVehicleComponentInSlot(vInfo[i][v_id_x],13);
    ChangeVehiclePaintjob(vInfo[i][v_id_x],vInfo[i][v_paintjob]);
    dini_IntSet(string,"Color_1",vInfo[i][v_color_1]);
    dini_IntSet(string,"Color_2",vInfo[i][v_color_2]);
    dini_IntSet(string,"v_spoiler",vInfo[i][v_spoiler]);
    dini_IntSet(string,"v_hood",vInfo[i][v_hood]);
    dini_IntSet(string,"v_roof",vInfo[i][v_roof]);
    dini_IntSet(string,"v_sideskirt",vInfo[i][v_sideskirt]);
    dini_IntSet(string,"v_lamps",vInfo[i][v_lamps]);
    dini_IntSet(string,"v_nitro",vInfo[i][v_nitro]);
    dini_IntSet(string,"v_exhaust",vInfo[i][v_exhaust]);
    dini_IntSet(string,"v_wheels",vInfo[i][v_wheels]);
    dini_IntSet(string,"v_stereo",vInfo[i][v_stereo]);
    dini_IntSet(string,"v_hydraulics",vInfo[i][v_hydraulics]);
    dini_IntSet(string,"v_front_bumper",vInfo[i][v_front_bumper]);
    dini_IntSet(string,"v_rear_bumper",vInfo[i][v_rear_bumper]);
    dini_IntSet(string,"v_vent_left",vInfo[i][v_vent_left]);
    dini_IntSet(string,"v_vent_right",vInfo[i][v_vent_right]);
    dini_IntSet(string,"v_paintjob",vInfo[i][v_paintjob]);
    dini_FloatSet(string,"Tank",vInfo[i][v_tank]);
    }
    return 1;
    }


    LoadCar(vdbid)
    {
    for( new i=1; i<sizeof vInfo; i++)
    {
    if(vInfo[i][v_id_x]!=0)continue;
    new string[164];
    format(string,sizeof string,"/autos/car %i.txt",vdbid);
    if(!dini_Exists(string))continue;
    new vID = getFreeCarID();
    SetVehicleParamsEx(i,0,0,0,0,0,0,0);
    vInfo[vID][v_db_id]= i;
    vInfo[vID][v_vehicleid]= dini_Int(string,"VehicleID");
    vInfo[vID][v_x]= dini_Float(string,"x");
    vInfo[vID][v_y]= dini_Float(string,"y");
    vInfo[vID][v_z]= dini_Float(string,"z");
    vInfo[vID][v_r]= dini_Float(string,"r");
    vInfo[vID][v_paintjob]=dini_Int(string,"v_paintjob");
    vInfo[vID][v_color_1]= dini_Int(string,"Color_1");
    vInfo[vID][v_color_2]= dini_Int(string,"Color_2");
    vInfo[vID][v_fraktion]= dini_Int(string,"Fraktion");
    vInfo[vID][v_tank]= dini_Float(string,"Tank");


    vInfo[vID][v_id_x]=CreateVehicle(vInfo[vID][v_vehicleid],vInfo[vID][v_x],vInfo[vID][v_y],vInfo[vID][v_z],vInfo[vID][v_r],vInfo[vID][v_color_1],vInfo[vID][v_color_2],0);
    ChangeVehiclePaintjob(vInfo[vID][v_id_x],vInfo[vID][v_paintjob]);
    vInfo[vID][v_status]=1;
    SetVehicleParamsEx(vInfo[vID][v_id_x],0,0,0,0,0,0,0);
    AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_spoiler"));
    AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_hood"));
    AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_roof"));
    AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_sideskirt"));
    AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_lamps"));
    AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_nitro"));
    AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_exhaust"));
    AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_wheels"));
    AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_stereo"));
    AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_hydraulics"));
    AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_front_bumper"));
    AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_rear_bumper"));
    AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_vent_left"));
    AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_vent_right"));
    printf("Auto// Verzeichnes: ../scriptfiles%s ID: %i geladen!",string,vID);
    return 1;
    }
    return 1;
    }


    if(dialogid==DIALOG_EDIT_CAR_COLOR_2)
    {
    if(response==1)
    {
    new vID = GetPlayerVehicleID(playerid);
    new Color2 = strlen(inputtext);
    for(new i=0; i<sizeof vInfo; i++)
    {
    if(vInfo[i][v_id_x]!=vID)continue;
    vInfo[i][v_color_2]=Color2;
    break;
    }
    SendClientMessage(playerid,grün,"Du hast die Lackierung des Wagens Geändert!");
    PlayerTextDrawShow(playerid,carlabel_background[playerid]);
    PlayerTextDrawShow(playerid,carlabel_heading[playerid]);
    PlayerTextDrawShow(playerid,carlabel_owner[playerid]);
    PlayerTextDrawShow(playerid,carlabel_color[playerid]);
    PlayerTextDrawShow(playerid,carlabel_delete[playerid]);
    }
    else
    {
    SendClientMessage(playerid,rot,"Du hast den Vorgang Abgebrochen!");
    }
    }
    if(dialogid==DIALOG_EDIT_CAR_COLOR)
    {
    if(response==1)
    {
    new vID = GetPlayerVehicleID(playerid);
    new Color1 = strlen(inputtext);
    for(new i=0; i<sizeof vInfo; i++)
    {
    if(vInfo[i][v_id_x]!=vID)continue;
    vInfo[i][v_color_1]=Color1;
    break;
    }
    ShowPlayerDialog(playerid,DIALOG_EDIT_CAR_COLOR_2,DIALOG_STYLE_INPUT,"Farbe aendern","Bitte gib Farbe 2 an\nVon 0-255","Abbrechen","Weiter");
    }
    else
    {
    SendClientMessage(playerid,rot,"Du hast den Vorgang Abgebrochen!");
    }
    }



    Vielen Dank schonmal an die Helfer

  • Versuche es so:
    ocmd:caredit(playerid,params[])
    {
    if(sInfo[playerid][Adminlevel]>=ADMIN_HIGH_ADMIN)
    {
    if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,rot,"Du bist in keinem Fahrzeug!");
    if(GetPVarInt(playerid,"CarEdit")==0)
    {
    SetPVarInt(playerid,"CarEdit",1);
    PlayerTextDrawShow(playerid,carlabel_background[playerid]);
    PlayerTextDrawShow(playerid,carlabel_heading[playerid]);
    PlayerTextDrawShow(playerid,carlabel_owner[playerid]);
    PlayerTextDrawShow(playerid,carlabel_color[playerid]);
    PlayerTextDrawShow(playerid,carlabel_delete[playerid]);
    SelectTextDraw(playerid,blau);
    return 1;
    }
    else if(GetPVarInt(playerid,"CarEdit")==1)
    {
    SetPVarInt(playerid,"CarEdit",0);
    new vID = GetPlayerVehicleID(playerid);
    for(new i=0; i<sizeof(vInfo); i++)
    {
    if(vInfo[i][v_id_x]!=vID)continue;
    SaveCar(vID);
    DestroyVehicle(vInfo[i][v_id_x]);
    vInfo[i][v_id_x]=0;
    LoadCar(Info[i][v_db_id]);
    PlayerTextDrawHide(playerid,carlabel_background[playerid]);
    PlayerTextDrawHide(playerid,carlabel_heading[playerid]);
    PlayerTextDrawHide(playerid,carlabel_owner[playerid]);
    PlayerTextDrawHide(playerid,carlabel_color[playerid]);
    PlayerTextDrawHide(playerid,carlabel_delete[playerid]);
    return 1;
    }
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid,rot,"Du darfst diesen Befhel nicht nutzen!");
    }
    return 1;
    }

  • Dann musst du den Befehl und die Speicherung mal debuggen:

    Spoiler anzeigen
    ocmd:caredit(playerid,params[])
    {
    printf("Start");
    if(sInfo[playerid][Adminlevel]>=ADMIN_HIGH_ADMIN)
    {
    if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,rot,"Du bist in keinem Fahrzeug!");
    if(GetPVarInt(playerid,"CarEdit")==0)
    {
    SetPVarInt(playerid,"CarEdit",1);
    PlayerTextDrawShow(playerid,carlabel_background[playerid]);
    PlayerTextDrawShow(playerid,carlabel_heading[playerid]);
    PlayerTextDrawShow(playerid,carlabel_owner[playerid]);
    PlayerTextDrawShow(playerid,carlabel_color[playerid]);
    PlayerTextDrawShow(playerid,carlabel_delete[playerid]);
    SelectTextDraw(playerid,blau);
    return 1;
    }
    else if(GetPVarInt(playerid,"CarEdit")==1)
    {
    SetPVarInt(playerid,"CarEdit",0);
    new vID = GetPlayerVehicleID(playerid);
    printf("ok");
    for(new i=0; i<sizeof(vInfo); i++)
    {
    if(vInfo[i][v_id_x]!=vID)continue;
    printf("cmd: vID: %d", vID);
    SaveCar(vID);
    DestroyVehicle(vInfo[i][v_id_x]);
    vInfo[i][v_id_x]=0;
    LoadCar(Info[i][v_db_id]);
    printf("Geladen.");
    PlayerTextDrawHide(playerid,carlabel_background[playerid]);
    PlayerTextDrawHide(playerid,carlabel_heading[playerid]);
    PlayerTextDrawHide(playerid,carlabel_owner[playerid]);
    PlayerTextDrawHide(playerid,carlabel_color[playerid]);
    PlayerTextDrawHide(playerid,carlabel_delete[playerid]);
    return 1;
    }
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid,rot,"Du darfst diesen Befhel nicht nutzen!");
    }
    return 1;
    }

    Spoiler anzeigen
    SaveCar(vID)
    {
    for(new i=0; i<sizeof(vInfo); i++)
    {
    if(vInfo[i][v_id_x]!=vID)continue;
    printf("In SaveCar: %d -> DB: %d", i, vInfo[i][v_db_id]);
    new string[64];
    format(string,sizeof string,"/autos/car %i.txt",vInfo[i][v_db_id]);
    new color1,color2;
    GetVehicleColor(vInfo[i][v_id_x], color1,color2);
    printf("GetVehicleColor: %d / %d", color1, color2);
    vInfo[i][v_color_1]=color1;
    vInfo[i][v_color_2]=color2;
    vInfo[i][v_spoiler]=GetVehicleComponentInSlot(vInfo[i][v_id_x],0);
    vInfo[i][v_hood]=GetVehicleComponentInSlot(vInfo[i][v_id_x],1);
    vInfo[i][v_roof]=GetVehicleComponentInSlot(vInfo[i][v_id_x],2);
    vInfo[i][v_sideskirt]=GetVehicleComponentInSlot(vInfo[i][v_id_x],3);
    vInfo[i][v_lamps]=GetVehicleComponentInSlot(vInfo[i][v_id_x],4);
    vInfo[i][v_nitro]=GetVehicleComponentInSlot(vInfo[i][v_id_x],5);
    vInfo[i][v_exhaust]=GetVehicleComponentInSlot(vInfo[i][v_id_x],6);
    vInfo[i][v_wheels]=GetVehicleComponentInSlot(vInfo[i][v_id_x],7);
    vInfo[i][v_stereo]=GetVehicleComponentInSlot(vInfo[i][v_id_x],8);
    vInfo[i][v_hydraulics]=GetVehicleComponentInSlot(vInfo[i][v_id_x],9);
    vInfo[i][v_front_bumper]=GetVehicleComponentInSlot(vInfo[i][v_id_x],10);
    vInfo[i][v_rear_bumper]=GetVehicleComponentInSlot(vInfo[i][v_id_x],11);
    vInfo[i][v_vent_left]=GetVehicleComponentInSlot(vInfo[i][v_id_x],12);
    vInfo[i][v_vent_right]=GetVehicleComponentInSlot(vInfo[i][v_id_x],13);
    ChangeVehiclePaintjob(vInfo[i][v_id_x],vInfo[i][v_paintjob]);
    dini_IntSet(string,"Color_1",vInfo[i][v_color_1]);
    dini_IntSet(string,"Color_2",vInfo[i][v_color_2]);
    dini_IntSet(string,"v_spoiler",vInfo[i][v_spoiler]);
    dini_IntSet(string,"v_hood",vInfo[i][v_hood]);
    dini_IntSet(string,"v_roof",vInfo[i][v_roof]);
    dini_IntSet(string,"v_sideskirt",vInfo[i][v_sideskirt]);
    dini_IntSet(string,"v_lamps",vInfo[i][v_lamps]);
    dini_IntSet(string,"v_nitro",vInfo[i][v_nitro]);
    dini_IntSet(string,"v_exhaust",vInfo[i][v_exhaust]);
    dini_IntSet(string,"v_wheels",vInfo[i][v_wheels]);
    dini_IntSet(string,"v_stereo",vInfo[i][v_stereo]);
    dini_IntSet(string,"v_hydraulics",vInfo[i][v_hydraulics]);
    dini_IntSet(string,"v_front_bumper",vInfo[i][v_front_bumper]);
    dini_IntSet(string,"v_rear_bumper",vInfo[i][v_rear_bumper]);
    dini_IntSet(string,"v_vent_left",vInfo[i][v_vent_left]);
    dini_IntSet(string,"v_vent_right",vInfo[i][v_vent_right]);
    dini_IntSet(string,"v_paintjob",vInfo[i][v_paintjob]);
    dini_FloatSet(string,"Tank",vInfo[i][v_tank]);
    printf("Gespeichert.");
    return 1;
    }
    return 1;
    }


    Was steht dann im Server Log, wenn du den Befehl eingibst?

  • [20:17:42] Start
    [20:17:49] Start
    [20:17:49] ok
    [20:17:49] cmd: vID: 1
    [20:17:49] In SaveCar: 0 -> DB: 1
    [20:17:49] GetVehicleColor: 0 / 0
    [20:17:49] Gespeichert.
    [20:17:49] Auto// Verzeichnes: ../scriptfiles/autos/car 1.txt ID: 0 geladen!
    [20:17:49] Geladen.

  • #include <getvehiclecolor>


    /*
    SA-MP "GetVehicleColor v2.1" Include
    Copyright © 2011 RyDeR`
    */


    #if defined _Included_GetVehicleColor
    #endinput
    #endif


    #define _Included_GetVehicleColor


    #define PROPERTY_OFFSET(%0) \
    ((((%0) * ((%0) << 1)) << 2) + 65536)


    stock n_AddStaticVehicle(modelID, Float: spawn_X, Float: spawn_Y, Float: spawn_Z, Float: z_Angle, color1, color2)
    {
    if(color1 < 0 || color2 < 0)
    {
    color1 = random(127);
    color2 = random(127);
    }
    modelID = AddStaticVehicle(modelID, spawn_X, spawn_Y, spawn_Z, z_Angle, color1, color2);

    new
    colorStr[24]
    ;
    format(colorStr, sizeof(colorStr), "%d-%d", color1, color2);
    setproperty(_, "", PROPERTY_OFFSET(modelID), colorStr);

    return modelID;
    }


    stock n_AddStaticVehicleEx(modelID, Float: spawn_X, Float: spawn_Y, Float: spawn_Z, Float: z_Angle, color1, color2, respawn_Delay)
    {
    if(color1 < 0 || color2 < 0)
    {
    color1 = random(127);
    color2 = random(127);
    }
    modelID = AddStaticVehicleEx(modelID, spawn_X, spawn_Y, spawn_Z, z_Angle, color1, color2, respawn_Delay);

    new
    colorStr[24]
    ;
    format(colorStr, sizeof(colorStr), "%d-%d", color1, color2);
    setproperty(_, "", PROPERTY_OFFSET(modelID), colorStr);

    return modelID;
    }


    stock n_CreateVehicle(modelID, Float: spawn_X, Float: spawn_Y, Float: spawn_Z, Float: z_Angle, color1, color2, respawn_Delay)
    {
    if(color1 < 0 || color2 < 0)
    {
    color1 = random(127);
    color2 = random(127);
    }
    modelID = CreateVehicle(modelID, spawn_X, spawn_Y, spawn_Z, z_Angle, color1, color2, respawn_Delay);

    new
    colorStr[24]
    ;
    format(colorStr, sizeof(colorStr), "%d-%d", color1, color2);
    setproperty(_, "", PROPERTY_OFFSET(modelID), colorStr);

    return modelID;
    }


    stock n_DestroyVehicle(vehicleID)
    {
    deleteproperty(_, "", PROPERTY_OFFSET(vehicleID));

    return DestroyVehicle(vehicleID);
    }


    stock n_ChangeVehicleColor(vehicleID, color1, color2)
    {
    new
    colorStr[24]
    ;
    format(colorStr, sizeof(colorStr), "%d-%d", color1, color2);
    setproperty(_, "", PROPERTY_OFFSET(vehicleID), colorStr);

    return ChangeVehicleColor(vehicleID, color1, color2);
    }


    public OnVehicleRespray(playerid, vehicleid, color1, color2)
    {
    new
    colorStr[24]
    ;
    format(colorStr, sizeof(colorStr), "%d-%d", color1, color2);
    setproperty(_, "", PROPERTY_OFFSET(vehicleid), colorStr);

    if(funcidx("n_OnVehicleRespray") != -1)
    {
    return CallLocalFunction("n_OnVehicleRespray", "iiii", playerid, vehicleid, color1, color2);
    }
    return 1;
    }


    stock GetVehicleColor(vehicleID, &color1, &color2)
    {
    vehicleID = PROPERTY_OFFSET(vehicleID);

    if(existproperty(_, "", vehicleID))
    {
    new
    colorStr[24],
    strPos
    ;
    getproperty(_, "", vehicleID, colorStr);
    strunpack(colorStr, colorStr);

    if((strPos = strfind(colorStr, "-")) != -1)
    {
    color1 = strval(colorStr);
    color2 = strval(colorStr[strPos + 1]);
    return 1;
    }
    }
    return 0;
    }


    #define AddStaticVehicle n_AddStaticVehicle
    #define AddStaticVehicleEx n_AddStaticVehicleEx
    #define CreateVehicle n_CreateVehicle
    #define DestroyVehicle n_DestroyVehicle
    #define ChangeVehicleColor n_ChangeVehicleColor


    #if defined _ALS_OnVehicleRespray
    #undef OnVehicleRespray
    #else
    #define _ALS_OnVehicleRespray
    #endif


    #define OnVehicleRespray n_OnVehicleRespray


    forward n_OnVehicleRespray(playerid, vehicleid, color1, color2);



    //edit
    wieso keine Antwort mehr weißt selbst nicht mehr weiter Jeffry ????

  • if(dialogid==DIALOG_EDIT_CAR_COLOR_2)
    {
    if(response==1)
    {
    new vID = GetPlayerVehicleID(playerid);
    new Color2 = strval(inputtext);
    for(new i=0; i<sizeof vInfo; i++)
    {
    if(vInfo[i][v_id_x]!=vID)continue;
    vInfo[i][v_color_2]=Color2;
    ChangeVehicleColor(vID, vInfo[i][v_color_1], vInfo[i][v_color_2]);
    break;
    }
    SendClientMessage(playerid,grün,"Du hast die Lackierung des Wagens Geändert!");
    PlayerTextDrawShow(playerid,carlabel_background[playerid]);
    PlayerTextDrawShow(playerid,carlabel_heading[playerid]);
    PlayerTextDrawShow(playerid,carlabel_owner[playerid]);
    PlayerTextDrawShow(playerid,carlabel_color[playerid]);
    PlayerTextDrawShow(playerid,carlabel_delete[playerid]);
    }
    else
    {
    SendClientMessage(playerid,rot,"Du hast den Vorgang Abgebrochen!");
    }
    }
    if(dialogid==DIALOG_EDIT_CAR_COLOR)
    {
    if(response==1)
    {
    new vID = GetPlayerVehicleID(playerid);
    new Color1 = strval(inputtext);
    for(new i=0; i<sizeof vInfo; i++)
    {
    if(vInfo[i][v_id_x]!=vID)continue;
    vInfo[i][v_color_1]=Color1;
    break;
    }
    ShowPlayerDialog(playerid,DIALOG_EDIT_CAR_COLOR_2,DIALOG_STYLE_INPUT,"Farbe aendern","Bitte gib Farbe 2 an\nVon 0-255","Abbrechen","Weiter");
    }
    else
    {
    SendClientMessage(playerid,rot,"Du hast den Vorgang Abgebrochen!");
    }
    }


    Ändere die beiden Dialoge dazu ab.

    3HZXdYd.png

    Einmal editiert, zuletzt von Jeffry ()