Fahrzeug UBB 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
  • Guten abend,


    Und zwar geht mein UBB nicht so ganz, wenn ich ein fahrzeug mit ein Gutschein erstelle geht das Fahrzeug A,
    wenn ich ein weiteres Fahrzeug erstelle wird anstadt Fahrzeug B das Neon an das Fahrzeug A dran gemacht und gespeichert.
    Ich bin bisschen am verzweifeln.


    Code:


    case DIALOG_GUTSCHEIN_UBB2:
    {
    if(response)
    {
    for(new vehSlot=0;vehSlot<MAX_PLAYER_VEHICLES;vehSlot++)
    {
    new type = listitem+1;
    switch(type)
    {
    case 1: // Blau
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18648, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18648, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 2: // Grün
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18649, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18649, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 3: // Weiß
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18652, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18652, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 4: // Pink
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18651, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18651, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 5: // Gelb
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18650, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18650, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 6: // Rot
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18647, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18647, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    }
    new query[256];
    PrivateVehicle[playerid][vehSlot][vehNeonID] = type;
    format(query, sizeof(query), "UPDATE `script_vehicles` SET `vehNeonID` = '%d' WHERE `vehBesitzer` = '%s' AND `Slot` = '%d'",type,PrivateVehicle[playerid][vehSlot][vehBesitzer],vehSlot);
    mysql_function_query(myCon, query, false, "", "");
    SendClientMessage(playerid, COLOR_WHITE, "* Dein Gutschein wurde erfolgreich eingelöst.");
    SendClientMessage(playerid, COLOR_WHITE, "* Das Fahrzeug wurde geliefert Du findest es auf Map.");
    SetPlayerCheckpointEx(playerid, -1706.9330,11.5702,3.2606, 5.0, CP_UBBCAR, INVALID_CHECKPOINT_TYPE);
    return 1;
    }
    }
    }


    Vielleicht kann der liebe Jeffry: mir helfen. :)

    Mit freundlichen Grüßen


  • Jeffry:


    Funktioniert leider immernoch nicht :/


    case DIALOG_GUTSCHEIN_UBB2:
    {
    if(response)
    {
    for(new vehSlot=0;vehSlot<MAX_PLAYER_VEHICLES;vehSlot++)
    {
    new type = listitem+1;
    if(PrivateVehicle[playerid][vehSlot] != 0)continue;
    switch(type)
    {
    case 1: // Blau
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18648, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18648, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 2: // Grün
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18649, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18649, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 3: // Weiß
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18652, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18652, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 4: // Pink
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18651, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18651, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 5: // Gelb
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18650, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18650, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 6: // Rot
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18647, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18647, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    }
    new query[256];
    PrivateVehicle[playerid][vehSlot][vehNeonID] = type;
    format(query, sizeof(query), "UPDATE `script_vehicles` SET `vehNeonID` = '%d' WHERE `vehBesitzer` = '%s' AND `Slot` = '%d'",type,PrivateVehicle[playerid][vehSlot][vehBesitzer],vehSlot+1);
    mysql_function_query(myCon, query, false, "", "");
    SendClientMessage(playerid, COLOR_WHITE, "* Dein Gutschein wurde erfolgreich eingelöst.");
    SendClientMessage(playerid, COLOR_WHITE, "* Das Fahrzeug wurde geliefert, Du findest es auf der Map.");
    SetPlayerCheckpointEx(playerid, -1706.9330,11.5702,3.2606, 5.0, CP_UBBCAR, INVALID_CHECKPOINT_TYPE);
    return 1;
    }
    }
    }

    Mit freundlichen Grüßen


  • Jeffry:


    Mit vehSlot wird die Datenbank ausgelesen.


    Zeige dir mal meinen CarKey.


    Befehl:


    Spoiler anzeigen
    CMD:carkey(playerid)
    {
    if(!IsLoggedIn(playerid))return 1;
    if(Spieler[playerid][pTutorial] > 0)return SendClientMessage(playerid, COLOR_GREY, "Du bist derzeit im Tutorial, und kannst keine Befehle benutzen.");
    new string1[64], string2[64], string3[64], string4[64];
    if(GetPlayerVehicleCount(playerid) == 0)return SendClientMessage(playerid, COLOR_GREY, "** Du besitzt keine Autoschlüssel.");
    if(PrivateVehicle[playerid][0][modelid] >= 400 && PrivateVehicle[playerid][0][modelid] <= 611) // Erster Slot
    {
    format(string1, sizeof(string1), "{FFFFFF}%s\n", VehicleName[PrivateVehicle[playerid][0][modelid]-400]);
    }
    else
    {
    format(string1, sizeof(string1), "{FFFFFF}-\n");
    }

    if(PrivateVehicle[playerid][1][modelid] >= 400 && PrivateVehicle[playerid][1][modelid] <= 611) // Zweiter Slot
    {
    format(string2, sizeof(string2), "{FFFFFF}%s\n", VehicleName[PrivateVehicle[playerid][1][modelid]-400]);
    }
    else
    {
    format(string2, sizeof(string2), "{FFFFFF}-\n");
    }

    if(PrivateVehicle[playerid][2][modelid] >= 400 && PrivateVehicle[playerid][2][modelid] <= 611) // Dritter Slot
    {
    format(string3, sizeof(string3), "{FFFFFF}%s\n", VehicleName[PrivateVehicle[playerid][2][modelid]-400]);
    }
    else
    {
    format(string3, sizeof(string3), "{FFFFFF}-\n");
    }

    if(PrivateVehicle[playerid][3][modelid] >= 400 && PrivateVehicle[playerid][3][modelid] <= 611) // Vierter Slot
    {
    format(string4, sizeof(string4), "{FFFFFF}%s\n", VehicleName[PrivateVehicle[playerid][3][modelid]-400]);
    }
    else
    {
    format(string4, sizeof(string4), "{FFFFFF}-\n");
    }
    strdel(DialogString, 0, sizeof(DialogString));
    format(DialogString, sizeof(DialogString), "%s%s%s%s", string1, string2, string3, string4);
    ShowPlayerDialog(playerid, DIALOG_CARKEYS, DIALOG_STYLE_LIST, "Deine Autoschlüssel", DialogString, "Orten", "Schließen");
    return 1;
    }



    Dialog:


    Spoiler anzeigen
    case DIALOG_CARKEYS:
    {
    if(response)
    {
    new id = listitem, Float:pos[3], string[128];
    if(PrivateVehicle[playerid][id][modelid] >= 400 && PrivateVehicle[playerid][id][modelid] <= 611)
    {
    GetVehiclePos(PrivateVehicle[playerid][id][vehID], pos[0], pos[1], pos[2]);
    SetPlayerCheckpointEx(playerid, pos[0], pos[1], pos[2], 5.0, CP_FINDCAR, INVALID_CHECKPOINT_TYPE);
    format(string, sizeof(string), COLOR_HEX_LIGHTBLUE"* Dein Fahrzeug ("COLOR_HEX_WHITE"%s"COLOR_HEX_LIGHTBLUE") wurde auf der Karte rot markiert.", VehicleName[PrivateVehicle[playerid][id][modelid]-400]);
    SendClientMessage(playerid, COLOR_WHITE, string);
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "** Du besitzt auf diesem Schlüssel kein Fahrzeug.");
    return 1;
    }
    }
    }

    Mit freundlichen Grüßen


  • @Jeffty:


    Das wird alles über ein Gutschein erstellt.
    ich habe gerade selber kein plan was Du brauchst :/


    Also wenn ich den Gutschein eingebe kommt ein Dialog wo ich mein Fahrzeug aussuche und wird auch erstellt.
    Danach kommt ein weiteres Dialog wo ich das Neon aussuchen kann und da überschneidet sich das.

    Mit freundlichen Grüßen


  • Ich kann dir auch nicht genau sagen was ich brauche, da ich ja dein System nicht kenne, aber das was du jetzt beschrieben hast klingt vielversprechend.
    Poste bitte mal den Code zu dem was du gerade beschrieben hast, am besten der Reihenfolge nach, was von Anfang an aufgerufen wird, bis zum Ende.

  • Jeffry:


    Wo ich das Fahrzeug auswählen kann.


    Spoiler anzeigen
    case DIALOG_GUTSCHEIN_INFORMATIONEN:
    {
    if(response)
    {
    for(new i=0; i<sizeof(Gutschein); i++)
    {
    new string[128];new query[150];
    if(Gutschein[i][ID] == 0)continue;
    if(GetPVarInt(playerid, "Code") != Gutschein[i][Gutscheincode])continue;
    switch(Gutschein[i][Gutscheintyp])
    {
    case 1: { Spieler[playerid][pPremium] = 1; Spieler[playerid][pPremiumTage] = gettime()+(86400*7); }
    case 2: { Spieler[playerid][pPremium] = 1; Spieler[playerid][pPremiumTage] = gettime()+(86400*14); }
    case 3: { Spieler[playerid][pPremium] = 2; Spieler[playerid][pPremiumTage] = gettime()+(86400*3640); }
    case 4: { Spieler[playerid][pExp] += 4; }
    case 5: { Spieler[playerid][pExp] += 8; }
    case 6: { Spieler[playerid][pExp] += 12; }
    case 7: { GiveMoney(playerid, 7500); }
    case 8: { GiveMoney(playerid, 15000); }
    case 9: { GiveMoney(playerid, 25000); }
    }
    Gutschein[i][Vorhanden] = 1;
    format(query, sizeof(query), "UPDATE `script_gutscheine` SET `Vorhanden` = '1', `EingeloestName` = '%s' WHERE `Gutscheincode` = '%d'",GetName(playerid), Gutschein[i][Gutscheincode]);
    mysql_function_query(myCon, query, false, "", "");
    if(Gutschein[i][Gutscheintyp] == 10){return ShowPlayerDialog(playerid, DIALOG_GUTSCHEIN_UBB, DIALOG_STYLE_LIST, "Fahrzeug", "Sultan\nJester\nInfernus\nTurismo\nBullet\nZR-350\nBanshee\nCheetah\nSuper GT", "Auswählen", "");}
    format(string,sizeof(string),"{FFFFFF}Du hast erfolgreich deinen Gutscheincode {40A5FE}%s{FFFFFF} eingelöst.\n",GetPremiumStatus(Gutschein[i][Gutscheintyp]));
    ShowPlayerDialog(playerid, DIALOG_GUTSCHEIN_EINGELOEST, DIALOG_STYLE_MSGBOX, "Gutschein eingelöst",string, "Schließen", "");
    return 1;
    }
    return 1;
    }
    if(!response)
    {
    return 1;
    }
    }



    Fahrzeug wird erstell und danach wird das Neon Dialog geöffnet



    Spoiler anzeigen
    case DIALOG_GUTSCHEIN_UBB:
    {
    if(response)
    {
    new type = listitem+1;
    switch(type)
    {
    case 1: { CreatePlayerVehicle(playerid, 560, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    case 2: { CreatePlayerVehicle(playerid, 559, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    case 3: { CreatePlayerVehicle(playerid, 411, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    case 4: { CreatePlayerVehicle(playerid, 451, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    case 5: { CreatePlayerVehicle(playerid, 541, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    case 6: { CreatePlayerVehicle(playerid, 477, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    case 7: { CreatePlayerVehicle(playerid, 429, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    case 8: { CreatePlayerVehicle(playerid, 415, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    case 9: { CreatePlayerVehicle(playerid, 506, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    }
    SetVehicleParamsEx(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, alarm, doors, bonnet, boot, objective);
    ShowPlayerDialog(playerid, DIALOG_GUTSCHEIN_UBB2, DIALOG_STYLE_LIST, "Unterbodenbeleichtung", "Blau\nGrün\nWeiss\nPink\nGelb\nRot", "Auswählen", "");
    return 1;
    }
    }



    Wo das Neon am Fahrzeug dran gemacht wird. ( Aber da überschneidet sich das alles)


    Spoiler anzeigen
    case DIALOG_GUTSCHEIN_UBB2:
    {
    if(response)
    {
    for(new vehSlot=0;vehSlot<MAX_PLAYER_VEHICLES;vehSlot++)
    {
    new type = listitem+1;
    switch(type)
    {
    case 1: // Blau
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18648, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18648, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 2: // Grün
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18649, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18649, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 3: // Weiß
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18652, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18652, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 4: // Pink
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18651, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18651, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 5: // Gelb
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18650, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18650, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 6: // Rot
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18647, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18647, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    }
    new query[256];
    PrivateVehicle[playerid][vehSlot][vehNeonID] = type;
    format(query, sizeof(query), "UPDATE `script_vehicles` SET `vehNeonID` = '%d' WHERE `vehBesitzer` = '%s' AND `Slot` = '%d'",type,PrivateVehicle[playerid][vehSlot][vehBesitzer],vehSlot);
    mysql_function_query(myCon, query, false, "", "");
    SendClientMessage(playerid, COLOR_WHITE, "* Dein Gutschein wurde erfolgreich eingelöst.");
    SendClientMessage(playerid, COLOR_WHITE, "* Das Fahrzeug wurde geliefert, Du findest es auf der Map.");
    SetPlayerCheckpointEx(playerid, -1706.9330,11.5702,3.2606, 5.0, CP_UBBCAR, INVALID_CHECKPOINT_TYPE);
    return 1;
    }
    }
    }

    Mit freundlichen Grüßen


  • Du musst bei CreatePlayerVehicle den Slot returnen. Dann, bei der Auswahl des Fahrzeugs, wo es erstellt wird, speicherst du die Rückgabe von CreatePlayerVehicle in eine Spielervariable.


    Und bei der Schleife beim Neon hinzufügen fragst du dann an ob vehSlot == Spielervariable ist.


    Falls du mit dem Code nicht klar kommst poste bitte dein CreatePlayerVehicle noch, dann mache ich dir das heute Mittag kurz.

  • Jeffry:


    Code:


    Spoiler anzeigen
    stock CreatePlayerVehicle(playerid, vehmodel, Float:posx, Float:posy, Float:posz, Float:posa, numberplate[], preis, neon, color1, color2)
    {
    new mainQuery[1537], secondQuery[256];
    for(new slot=0;slot<MAX_PLAYER_VEHICLES;slot++)
    {
    if(PrivateVehicle[playerid][slot][modelid] == 0)
    {
    format(PrivateVehicle[playerid][slot][vehBesitzer], 24, "%s", GetName(playerid));
    PrivateVehicle[playerid][slot][modelid] = vehmodel;
    PrivateVehicle[playerid][slot][vehPosX] = posx;
    PrivateVehicle[playerid][slot][vehPosY] = posy;
    PrivateVehicle[playerid][slot][vehPosZ] = posz;
    PrivateVehicle[playerid][slot][vehPosA] = posa;
    PrivateVehicle[playerid][slot][vehInterior] = GetPlayerInterior(playerid);
    PrivateVehicle[playerid][slot][vehWorld] = GetPlayerVirtualWorld(playerid);
    PrivateVehicle[playerid][slot][vehColor1] = color1;
    PrivateVehicle[playerid][slot][vehColor2] = color2;
    PrivateVehicle[playerid][slot][vehPaintjob] = -1;
    PrivateVehicle[playerid][slot][vehSpoiler] = 0;
    PrivateVehicle[playerid][slot][vehHood] = 0;
    PrivateVehicle[playerid][slot][vehRoof] = 0;
    PrivateVehicle[playerid][slot][vehSideskirt] = 0;
    PrivateVehicle[playerid][slot][vehLamps] = 0;
    PrivateVehicle[playerid][slot][vehNitro] = 0;
    PrivateVehicle[playerid][slot][vehExhaust] = 0;
    PrivateVehicle[playerid][slot][vehWheels] = 0;
    PrivateVehicle[playerid][slot][vehStereo] = 0;
    PrivateVehicle[playerid][slot][vehHydraulics] = 0;
    PrivateVehicle[playerid][slot][vehFrontBumper] = 0;
    PrivateVehicle[playerid][slot][vehRearBumper] = 0;
    PrivateVehicle[playerid][slot][vehVentRight] = 0;
    PrivateVehicle[playerid][slot][vehVentLeft] = 0;
    PrivateVehicle[playerid][slot][vehPreis] = preis;
    PrivateVehicle[playerid][slot][vehHealth] = 1000.0;
    PrivateVehicle[playerid][slot][vehNeonID] = neon;
    PrivateVehicle[playerid][slot][vehTankKM] = 0;
    PrivateVehicle[playerid][slot][vehKMStandCount] = 0;
    PrivateVehicle[playerid][slot][vehKMStand] = 0;
    format(PrivateVehicle[playerid][slot][vehNumberPlate], 16, numberplate);
    PrivateVehicle[playerid][slot][vehID] = CreateVehicleEx(PrivateVehicle[playerid][slot][modelid], PrivateVehicle[playerid][slot][vehPosX], PrivateVehicle[playerid][slot][vehPosY], PrivateVehicle[playerid][slot][vehPosZ], PrivateVehicle[playerid][slot][vehPosA], PrivateVehicle[playerid][slot][vehColor1], PrivateVehicle[playerid][slot][vehColor2], -1, false);
    new playerName[MAX_PLAYER_NAME+1], nPlate[32], cutName[24+1];
    GetPlayerName(playerid, playerName, sizeof(playerName));
    strmid(cutName, playerName, 0, 1, sizeof(cutName));
    format(nPlate, sizeof(nPlate), "%s",GetName(playerid));
    SetVehicleNumberPlate(PrivateVehicle[playerid][slot][vehID], nPlate);
    SetVehicleHealth(PrivateVehicle[playerid][slot][vehID], PrivateVehicle[playerid][slot][vehHealth]);
    strdel(mainQuery, 0, sizeof(mainQuery));
    strcat(mainQuery, "INSERT INTO `script_vehicles` (`vehBesitzer`, `slot`, `modelid`, `vehPosX`, `vehPosY`, `vehPosZ`, `vehPosA`, `vehHealth`, `vehColor1`, `vehColor2`, ");
    strcat(mainQuery, "`vehPaintjob`, `vehSpoiler`, `vehHood`, `vehRoof`, `vehSideskirt`, `vehLamps`, `vehNitro`, `vehExhaust`, `vehWheels`, `vehStereo`, `vehHydraulics`, ");
    strcat(mainQuery, "`vehFrontBumper`, `vehRearBumper`, `vehVentRight`, `vehVentLeft`, `vehPreis`, `vehNeonID`, `vehNumberPlate`, `vehFuel`, `vehKMStand`, `vehInterior`, ");
    strcat(mainQuery, "`vehWorld`) VALUES (");
    format(secondQuery, sizeof(secondQuery), "'%s', '%d', '%d', '%f', '%f', '%f', '%f', '%f', '%d', '%d', ",
    PrivateVehicle[playerid][slot][vehBesitzer], slot, PrivateVehicle[playerid][slot][modelid], PrivateVehicle[playerid][slot][vehPosX],
    PrivateVehicle[playerid][slot][vehPosY], PrivateVehicle[playerid][slot][vehPosZ], PrivateVehicle[playerid][slot][vehPosA],
    PrivateVehicle[playerid][slot][vehHealth], PrivateVehicle[playerid][slot][vehColor1], PrivateVehicle[playerid][slot][vehColor2]);
    strcat(mainQuery, secondQuery);
    format(secondQuery, sizeof(secondQuery), "'%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', ",
    PrivateVehicle[playerid][slot][vehPaintjob], PrivateVehicle[playerid][slot][vehSpoiler], PrivateVehicle[playerid][slot][vehHood],
    PrivateVehicle[playerid][slot][vehRoof], PrivateVehicle[playerid][slot][vehSideskirt], PrivateVehicle[playerid][slot][vehLamps],
    PrivateVehicle[playerid][slot][vehNitro], PrivateVehicle[playerid][slot][vehExhaust], PrivateVehicle[playerid][slot][vehWheels],
    PrivateVehicle[playerid][slot][vehStereo], PrivateVehicle[playerid][slot][vehHydraulics]);
    strcat(mainQuery, secondQuery);
    format(secondQuery, sizeof(secondQuery), "'%d', '%d', '%d', '%d', '%d', '%d', '%s', '%f', '%f', '%d', '%d')",
    PrivateVehicle[playerid][slot][vehFrontBumper], PrivateVehicle[playerid][slot][vehRearBumper], PrivateVehicle[playerid][slot][vehVentRight],
    PrivateVehicle[playerid][slot][vehVentLeft], PrivateVehicle[playerid][slot][vehPreis], PrivateVehicle[playerid][slot][vehNeonID],
    PrivateVehicle[playerid][slot][vehNumberPlate], PrivateVehicle[playerid][slot][vehFuel], PrivateVehicle[playerid][slot][vehKMStand],
    PrivateVehicle[playerid][slot][vehInterior], PrivateVehicle[playerid][slot][vehWorld]);
    strcat(mainQuery, secondQuery);
    mysql_function_query(myCon, mainQuery, false, "", "");
    SetVehicleToRespawn(PrivateVehicle[playerid][slot][vehID]);
    Vehicle[PrivateVehicle[playerid][slot][vehID]][vehFuel] = VehicleData[vehmodel-400][vehMaxTank];
    return 1;
    }
    }
    return 1;
    }



    //e


    Vielleicht weiss ein anderer was.
    Da ich nicht weiss wann Jeffry: online kommst. :/



    via Handy geschrieben

    Mit freundlichen Grüßen


    Einmal editiert, zuletzt von CptSky_ ()

  • stock CreatePlayerVehicle(playerid, vehmodel, Float:posx, Float:posy, Float:posz, Float:posa, numberplate[], preis, neon, color1, color2)
    {
    new mainQuery[1537], secondQuery[256];
    for(new slot=0;slot<MAX_PLAYER_VEHICLES;slot++)
    {
    if(PrivateVehicle[playerid][slot][modelid] == 0)
    {
    format(PrivateVehicle[playerid][slot][vehBesitzer], 24, "%s", GetName(playerid));
    PrivateVehicle[playerid][slot][modelid] = vehmodel;
    PrivateVehicle[playerid][slot][vehPosX] = posx;
    PrivateVehicle[playerid][slot][vehPosY] = posy;
    PrivateVehicle[playerid][slot][vehPosZ] = posz;
    PrivateVehicle[playerid][slot][vehPosA] = posa;
    PrivateVehicle[playerid][slot][vehInterior] = GetPlayerInterior(playerid);
    PrivateVehicle[playerid][slot][vehWorld] = GetPlayerVirtualWorld(playerid);
    PrivateVehicle[playerid][slot][vehColor1] = color1;
    PrivateVehicle[playerid][slot][vehColor2] = color2;
    PrivateVehicle[playerid][slot][vehPaintjob] = -1;
    PrivateVehicle[playerid][slot][vehSpoiler] = 0;
    PrivateVehicle[playerid][slot][vehHood] = 0;
    PrivateVehicle[playerid][slot][vehRoof] = 0;
    PrivateVehicle[playerid][slot][vehSideskirt] = 0;
    PrivateVehicle[playerid][slot][vehLamps] = 0;
    PrivateVehicle[playerid][slot][vehNitro] = 0;
    PrivateVehicle[playerid][slot][vehExhaust] = 0;
    PrivateVehicle[playerid][slot][vehWheels] = 0;
    PrivateVehicle[playerid][slot][vehStereo] = 0;
    PrivateVehicle[playerid][slot][vehHydraulics] = 0;
    PrivateVehicle[playerid][slot][vehFrontBumper] = 0;
    PrivateVehicle[playerid][slot][vehRearBumper] = 0;
    PrivateVehicle[playerid][slot][vehVentRight] = 0;
    PrivateVehicle[playerid][slot][vehVentLeft] = 0;
    PrivateVehicle[playerid][slot][vehPreis] = preis;
    PrivateVehicle[playerid][slot][vehHealth] = 1000.0;
    PrivateVehicle[playerid][slot][vehNeonID] = neon;
    PrivateVehicle[playerid][slot][vehTankKM] = 0;
    PrivateVehicle[playerid][slot][vehKMStandCount] = 0;
    PrivateVehicle[playerid][slot][vehKMStand] = 0;
    format(PrivateVehicle[playerid][slot][vehNumberPlate], 16, numberplate);
    PrivateVehicle[playerid][slot][vehID] = CreateVehicleEx(PrivateVehicle[playerid][slot][modelid], PrivateVehicle[playerid][slot][vehPosX], PrivateVehicle[playerid][slot][vehPosY], PrivateVehicle[playerid][slot][vehPosZ], PrivateVehicle[playerid][slot][vehPosA], PrivateVehicle[playerid][slot][vehColor1], PrivateVehicle[playerid][slot][vehColor2], -1, false);
    new playerName[MAX_PLAYER_NAME+1], nPlate[32], cutName[24+1];
    GetPlayerName(playerid, playerName, sizeof(playerName));
    strmid(cutName, playerName, 0, 1, sizeof(cutName));
    format(nPlate, sizeof(nPlate), "%s",GetName(playerid));
    SetVehicleNumberPlate(PrivateVehicle[playerid][slot][vehID], nPlate);
    SetVehicleHealth(PrivateVehicle[playerid][slot][vehID], PrivateVehicle[playerid][slot][vehHealth]);
    strdel(mainQuery, 0, sizeof(mainQuery));
    strcat(mainQuery, "INSERT INTO `script_vehicles` (`vehBesitzer`, `slot`, `modelid`, `vehPosX`, `vehPosY`, `vehPosZ`, `vehPosA`, `vehHealth`, `vehColor1`, `vehColor2`, ");
    strcat(mainQuery, "`vehPaintjob`, `vehSpoiler`, `vehHood`, `vehRoof`, `vehSideskirt`, `vehLamps`, `vehNitro`, `vehExhaust`, `vehWheels`, `vehStereo`, `vehHydraulics`, ");
    strcat(mainQuery, "`vehFrontBumper`, `vehRearBumper`, `vehVentRight`, `vehVentLeft`, `vehPreis`, `vehNeonID`, `vehNumberPlate`, `vehFuel`, `vehKMStand`, `vehInterior`, ");
    strcat(mainQuery, "`vehWorld`) VALUES (");
    format(secondQuery, sizeof(secondQuery), "'%s', '%d', '%d', '%f', '%f', '%f', '%f', '%f', '%d', '%d', ",
    PrivateVehicle[playerid][slot][vehBesitzer], slot, PrivateVehicle[playerid][slot][modelid], PrivateVehicle[playerid][slot][vehPosX],
    PrivateVehicle[playerid][slot][vehPosY], PrivateVehicle[playerid][slot][vehPosZ], PrivateVehicle[playerid][slot][vehPosA],
    PrivateVehicle[playerid][slot][vehHealth], PrivateVehicle[playerid][slot][vehColor1], PrivateVehicle[playerid][slot][vehColor2]);
    strcat(mainQuery, secondQuery);
    format(secondQuery, sizeof(secondQuery), "'%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', ",
    PrivateVehicle[playerid][slot][vehPaintjob], PrivateVehicle[playerid][slot][vehSpoiler], PrivateVehicle[playerid][slot][vehHood],
    PrivateVehicle[playerid][slot][vehRoof], PrivateVehicle[playerid][slot][vehSideskirt], PrivateVehicle[playerid][slot][vehLamps],
    PrivateVehicle[playerid][slot][vehNitro], PrivateVehicle[playerid][slot][vehExhaust], PrivateVehicle[playerid][slot][vehWheels],
    PrivateVehicle[playerid][slot][vehStereo], PrivateVehicle[playerid][slot][vehHydraulics]);
    strcat(mainQuery, secondQuery);
    format(secondQuery, sizeof(secondQuery), "'%d', '%d', '%d', '%d', '%d', '%d', '%s', '%f', '%f', '%d', '%d')",
    PrivateVehicle[playerid][slot][vehFrontBumper], PrivateVehicle[playerid][slot][vehRearBumper], PrivateVehicle[playerid][slot][vehVentRight],
    PrivateVehicle[playerid][slot][vehVentLeft], PrivateVehicle[playerid][slot][vehPreis], PrivateVehicle[playerid][slot][vehNeonID],
    PrivateVehicle[playerid][slot][vehNumberPlate], PrivateVehicle[playerid][slot][vehFuel], PrivateVehicle[playerid][slot][vehKMStand],
    PrivateVehicle[playerid][slot][vehInterior], PrivateVehicle[playerid][slot][vehWorld]);
    strcat(mainQuery, secondQuery);
    mysql_function_query(myCon, mainQuery, false, "", "");
    SetVehicleToRespawn(PrivateVehicle[playerid][slot][vehID]);
    Vehicle[PrivateVehicle[playerid][slot][vehID]][vehFuel] = VehicleData[vehmodel-400][vehMaxTank];
    return slot;
    }
    }
    return -1;
    }



    case DIALOG_GUTSCHEIN_UBB:
    {
    if(response)
    {
    new type = listitem+1, slot;
    switch(type)
    {
    case 1: { slot = CreatePlayerVehicle(playerid, 560, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    case 2: { slot = CreatePlayerVehicle(playerid, 559, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    case 3: { slot = CreatePlayerVehicle(playerid, 411, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    case 4: { slot = CreatePlayerVehicle(playerid, 451, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    case 5: { slot = CreatePlayerVehicle(playerid, 541, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    case 6: { slot = CreatePlayerVehicle(playerid, 477, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    case 7: { slot = CreatePlayerVehicle(playerid, 429, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    case 8: { slot = CreatePlayerVehicle(playerid, 415, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    case 9: { slot = CreatePlayerVehicle(playerid, 506, -1706.9330,11.5702,3.2606,316.5364,GetName(playerid),0,0,0,0); }
    }
    if(slot == -1) return SendClientMessage(playerid, 0xFF0000FF, "Error: Fahrzeug konnte nicht erstellt werden.");
    SetPVarInt(playerid, "slotID", slot);
    SetVehicleParamsEx(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, alarm, doors, bonnet, boot, objective);
    ShowPlayerDialog(playerid, DIALOG_GUTSCHEIN_UBB2, DIALOG_STYLE_LIST, "Unterbodenbeleichtung", "Blau\nGrün\nWeiss\nPink\nGelb\nRot", "Auswählen", "");
    return 1;
    }
    }



    case DIALOG_GUTSCHEIN_UBB2:
    {
    if(response)
    {
    new vehSlot = GetPVarInt(playerid, "slotID");
    new type = listitem+1;
    switch(type)
    {
    case 1: // Blau
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18648, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18648, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 2: // Grün
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18649, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18649, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 3: // Weiß
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18652, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18652, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 4: // Pink
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18651, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18651, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 5: // Gelb
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18650, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18650, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    case 6: // Rot
    {
    PrivateVehicle[playerid][vehSlot][vehNeon1] = CreateDynamicObject(18647, 0, 0, 0, 0, 0, 0, 0);
    PrivateVehicle[playerid][vehSlot][vehNeon2] = CreateDynamicObject(18647, 0, 0, 0, 0, 0, 0, 0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon1], PrivateVehicle[playerid][vehSlot][vehID], -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    AttachDynamicObjectToVehicle(PrivateVehicle[playerid][vehSlot][vehNeon2], PrivateVehicle[playerid][vehSlot][vehID], 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
    }
    }
    new query[256];
    PrivateVehicle[playerid][vehSlot][vehNeonID] = type;
    format(query, sizeof(query), "UPDATE `script_vehicles` SET `vehNeonID` = '%d' WHERE `vehBesitzer` = '%s' AND `Slot` = '%d'",type,PrivateVehicle[playerid][vehSlot][vehBesitzer],vehSlot);
    mysql_function_query(myCon, query, false, "", "");
    SendClientMessage(playerid, COLOR_WHITE, "* Dein Gutschein wurde erfolgreich eingelöst.");
    SendClientMessage(playerid, COLOR_WHITE, "* Das Fahrzeug wurde geliefert, Du findest es auf der Map.");
    SetPlayerCheckpointEx(playerid, -1706.9330,11.5702,3.2606, 5.0, CP_UBBCAR, INVALID_CHECKPOINT_TYPE);
    return 1;
    }
    }


    So sollte es passen.

  • Jeffry:


    Also wenn ein Spieler auf dem Server kommt, kriegt er immer nur die ID womit er sich registiert hat, aber ich speicher keine ID ab vom Spieler.
    Wenn er sein Führerschein machen will Spawnt das Fahrzeug mit Neon.
    Er holt sich ein BMX spawnt es auch mit Neon.


    mal der BMX Code:


    Spoiler anzeigen
    CMD:fahrrad(playerid)
    {
    if(!IsLoggedIn(playerid))return 1;
    if(Spieler[playerid][pLevel] >= 3)return SendClientMessage(playerid, COLOR_GREY, "** Fahrräder können nur unter Level 3 gemietet werden!");
    if(Spieler[playerid][pBike] != INVALID_VEHICLE_ID)return SendClientMessage(playerid, COLOR_GREY, "** Du hast bereits ein Fahrrad gemietet. Tippe "COLOR_HEX_BLUE"/unrentfahrrad"COLOR_HEX_GREY" um es abzugeben.");
    if(!IsPlayerInRangeOfPoint(playerid, 3.0, 1772.1301,-1888.6050,13.5608))return SendClientMessage(playerid, COLOR_GREY, "** Du befindest dich nicht in der Nähe vom Fahrrad-Verleih!");
    if(Spieler[playerid][pTutorial] == 3)
    {
    Spieler[playerid][pBike] = CreateVehicleEx(481,1776.0751,-1885.7290,12.9027,268.8185,0,0,-1,true);
    PutPlayerInVehicleEx(playerid, Spieler[playerid][pBike], 0);
    ShowInfo(playerid, "~b~"SERVER_NAME" - Tutorial", "Das Fahrrad kannst du jederzeit mit ~b~/lock~n~~w~oeffnen und schliessen, sodass dir ~n~dieses niemand stehlen kann!~n~~n~Bitte fahre nun zur Stadthalle.~n~Diese wurde dir bereits ~r~rot~w~ auf der Karte markiert.");
    SetPlayerCheckpointEx(playerid, 1479.8075,-1742.3326,13.5469, 2.0, CP_TUTORIAL_2, CP_TYPE_TUTORIAL);
    LockVehicle(Spieler[playerid][pBike]);
    GameTextForPlayer(playerid, "~w~Fahrrad~n~~r~abgeschlossen", 3000, 6);
    SavePlayer(playerid);
    }
    else
    {
    if(GetMoney(playerid) < 200)return SendClientMessage(playerid, COLOR_GREY, ERROR_MONEY);
    Spieler[playerid][pBike] = CreateVehicleEx(481,1776.0751,-1885.7290,12.9027,268.8185,0,0,-1,true);
    PutPlayerInVehicleEx(playerid, Spieler[playerid][pBike], 0);
    LockVehicle(Spieler[playerid][pBike]);
    GameTextForPlayer(playerid, "~w~Fahrrad~n~~r~abgeschlossen", 3000, 6);
    }
    return 1;
    }

    Mit freundlichen Grüßen


  • Bist du dir sicher, dass das korrekt gelöscht wird? Weil es kann laut dem Code nicht sein, dass da plötzlich Neon dran ist.
    Ist das auch der Fall, wenn du den Server neu startest und als erstes ein BMX spawnst? Wenn nein, dann poste bitte mal den Code mit dem du das Neon löschst.

  • Jeffry:


    public OnVehicleDeath(vehicleid, killerid)
    {
    if(Vehicle[vehicleid][vehMotor])KillTimer(Vehicle[vehicleid][VehicleTimer]);
    Vehicle[vehicleid][vehMotor] = false; Vehicle[vehicleid][vehLicht] = false;
    Vehicle[vehicleid][vehHaube] = false; Vehicle[vehicleid][vehKRaum] = false;
    DestroyDynamicObject(Vehicle[vehicleid][vehNeon1]);
    DestroyDynamicObject(Vehicle[vehicleid][vehNeon2]);
    Vehicle[vehicleid][vehNeon1] = INVALID_OBJECT_ID;
    Vehicle[vehicleid][vehNeon2] = INVALID_OBJECT_ID;
    return 1;
    }



    case DIALOG_CARSELL2:
    {
    if(response)
    {
    if(GetPlayerVehicleCount(playerid))
    {
    new query[128];
    new preis = PrivateVehicle[playerid][currentslot[playerid]][vehPreis]/2;
    if(!strcmp(GetName(playerid), PrivateVehicle[playerid][currentslot[playerid]][vehBesitzer], true))
    {
    if(PrivateVehicle[playerid][currentslot[playerid]][modelid] != 0 && IsValidVehicle(PrivateVehicle[playerid][currentslot[playerid]][vehID]))
    {
    format(query, sizeof(query), COLOR_HEX_LIGHTBLUE"Du hast dein Fahrzeug ("COLOR_HEX_WHITE"%s"COLOR_HEX_LIGHTBLUE") erfolgreich für "COLOR_HEX_WHITE"$%d"COLOR_HEX_LIGHTBLUE" verkauft.", VehicleName[PrivateVehicle[playerid][currentslot[playerid]][modelid]-400],PrivateVehicle[playerid][currentslot[playerid]][vehPreis]);
    SendClientMessage(playerid, COLOR_WHITE, query);
    PrivateVehicle[playerid][currentslot[playerid]][modelid] = 0;
    PrivateVehicle[playerid][currentslot[playerid]][vehPosX] = -1;
    PrivateVehicle[playerid][currentslot[playerid]][vehPosY] = -1;
    PrivateVehicle[playerid][currentslot[playerid]][vehPosZ] = -1;
    PrivateVehicle[playerid][currentslot[playerid]][vehPosA] = -1;
    PrivateVehicle[playerid][currentslot[playerid]][vehColor1] = -1;
    PrivateVehicle[playerid][currentslot[playerid]][vehColor2] = -1;
    PrivateVehicle[playerid][currentslot[playerid]][vehPaintjob] = -1;
    PrivateVehicle[playerid][currentslot[playerid]][vehSpoiler] = 0;
    PrivateVehicle[playerid][currentslot[playerid]][vehHood] = 0;
    PrivateVehicle[playerid][currentslot[playerid]][vehRoof] = 0;
    PrivateVehicle[playerid][currentslot[playerid]][vehSideskirt] = 0;
    PrivateVehicle[playerid][currentslot[playerid]][vehLamps] = 0;
    PrivateVehicle[playerid][currentslot[playerid]][vehNitro] = 0;
    PrivateVehicle[playerid][currentslot[playerid]][vehExhaust] = 0;
    PrivateVehicle[playerid][currentslot[playerid]][vehWheels] = 0;
    PrivateVehicle[playerid][currentslot[playerid]][vehStereo] = 0;
    PrivateVehicle[playerid][currentslot[playerid]][vehHydraulics] = 0;
    PrivateVehicle[playerid][currentslot[playerid]][vehFrontBumper] = 0;
    PrivateVehicle[playerid][currentslot[playerid]][vehRearBumper] = 0;
    PrivateVehicle[playerid][currentslot[playerid]][vehVentRight] = 0;
    PrivateVehicle[playerid][currentslot[playerid]][vehVentLeft] = 0;
    GiveMoney(playerid, preis);
    PrivateVehicle[playerid][currentslot[playerid]][vehPreis] = 0;
    DestroyDynamicObject(PrivateVehicle[playerid][currentslot[playerid]][vehNeon1]);
    DestroyDynamicObject(PrivateVehicle[playerid][currentslot[playerid]][vehNeon2]);
    PrivateVehicle[playerid][currentslot[playerid]][vehNeon1] = INVALID_OBJECT_ID;
    PrivateVehicle[playerid][currentslot[playerid]][vehNeon2] = INVALID_OBJECT_ID;
    PrivateVehicle[playerid][currentslot[playerid]][vehNeonID] = 0;
    format(PrivateVehicle[playerid][currentslot[playerid]][vehBesitzer], 25,"-");
    DeleteVehicle(PrivateVehicle[playerid][currentslot[playerid]][vehID]);
    PrivateVehicle[playerid][currentslot[playerid]][vehID] = -1;
    mysql_format(myCon, query, sizeof(query), "DELETE FROM `script_vehicles` WHERE `vehBesitzer` = '%s' AND `Slot` = '%d'", GetName(playerid), currentslot[playerid]);
    mysql_tquery(myCon, query, "", "");
    }
    }
    }
    }
    }



    stock DeleteVehicle(vehicleid)
    {
    if(IsValidVehicle(vehicleid))
    {
    Vehicle[vehicleid][vehNeonID] = 0;
    DestroyDynamic3DTextLabel(Vehicle[vehicleid][vehText]);
    DestroyDynamic3DTextLabel(Vehicle[vehicleid][TaxiText]);
    DestroyDynamicObject(Vehicle[vehicleid][vehNeon1]);
    DestroyDynamicObject(Vehicle[vehicleid][vehNeon2]);
    Vehicle[vehicleid][vehNeon1] = INVALID_OBJECT_ID;
    Vehicle[vehicleid][vehNeon2] = INVALID_OBJECT_ID;
    Vehicle[vehicleid][vehKMStand] = 0;
    Vehicle[vehicleid][vehTankKM] = 0;
    Vehicle[vehicleid][vehKMStandCount] = 0;
    if(Vehicle[vehicleid][vehMotor])KillTimer(Vehicle[vehicleid][VehicleTimer]);
    Vehicle[vehicleid][vehMotor] = false;
    Vehicle[vehicleid][vehLicht] = false;
    Vehicle[vehicleid][vehHaube] = false;
    Vehicle[vehicleid][vehKRaum] = false;
    Vehicle[vehicleid][vehFuel] = VehicleData[GetVehicleModel(vehicleid)-400][vehMaxTank];
    Vehicle[vehicleid][vehPosX2] = -1;
    Vehicle[vehicleid][vehPosY2] = -1;
    Vehicle[vehicleid][vehPosZ2] = -1;
    DestroyVehicle(vehicleid);
    return 1;
    }
    return 0;
    }

    Mit freundlichen Grüßen