Problem mit Gutschein

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
  • Ich habe vor wen ein user ein UBB code einlöst kann er sich ein Fahrzeug wählen darum die liste und möchte es so machen das er eine zufall neon farbe bekommt. So genannt das er das Fahrzeug auch besitzt.


    //E:


    Hier das Car enum das sich die neon speichern und das er das Fahrzeug als Schlüssel bekommt.


    enum dtc_PlayerCar { CarId, CarOwner[MAX_PLAYER_NAME], CarModel, Float:CarPos_x, Float:CarPos_y, Float:CarPos_z, Float:CarRotate, CarNitro, CarHyd, CarWheel, CarAusp, CarSideL, CarSideR, CarFB, CarRB, CarSpoiler, CarRoof, CarHood, CarVents, CarLamps, CarPJ, CarC1, CarC2, CarPreis, CarArrest, Plate[15], }; new PlayerCar[MAX_PLAYERS][MaxVeh][dtc_PlayerCar];


    //E:


    Kann sein das es in einer reihe gezeigt wird da ich am Handy bin. Bin nicht zuhause.

    Einmal editiert, zuletzt von DerFamer ()

  • also
    macht macht /creategutschein den kommt da der code


    den löst man unter /gutschein ein
    und den soll vor ein / ein bestimmter ort ein Fahrzeug Spawnen was ich ausgesucht habe mit den Neon-Röhren die Bleiben den für immer dran


    aber wir haben das Problem das das Fahrzeug net spawnt

  • enum dtc_PlayerCar
    {
    CarId,
    CarOwner[MAX_PLAYER_NAME],
    CarModel,
    Float:CarPos_x,
    Float:CarPos_y,
    Float:CarPos_z,
    Float:CarRotate,
    CarNitro,
    CarHyd,
    CarWheel,
    CarAusp,
    CarSideL,
    CarSideR,
    CarFB,
    CarRB,
    CarSpoiler,
    CarRoof,
    CarHood,
    CarVents,
    CarLamps,
    CarPJ,
    CarC1,
    CarC2,
    CarPreis,
    CarArrest,
    Plate[15],
    };


    Das Car Enum dazu!


    //E:
    Ich habe vor wen ein user ein UBB code einlöst kann er sich ein Fahrzeug wählen darum die liste und möchte es so machen das er eine zufall neon farbe bekommt. So genannt das er das Fahrzeug auch besitzt.

  • Also, das mit den Privaten Fahrzeugen kann ich dir so nicht direkt zeigen, dazu fehlt der entsprechende Code, das kannst du aber auch selbst einfügen, du schaust einfach, wie du sonst diese Fahrzeuge erstellst und setzt das dann an die "new vID..." Stelle.


    Gegebenenfalls nimmst du hier auch lieber einen switch, ich habe es aber mal so gelassen wie du angefangen hast:
    if(dialogid == DIALOG_GUTSCHEINCARTAKE)
    {
    if(listitem == 0)//Sultan 560
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new vID = CreateVehicle(560, x, y, z, a, -1, -1, -1);
    PutPlayerInVehicle(playerid, vID, 0);
    GiveRandomNeon(vID, playerid);
    return 1;
    }
    if(listitem == 1) //Infernus 411
    {

    }
    if(listitem == 2)//Turismo 451
    {

    }
    if(listitem == 3)//Cheetah 415
    {

    }
    if(listitem == 4)//Premiuer 426
    {

    }
    if(listitem == 5)//Banshee 429
    {

    }
    if(listitem == 6)//Zr350 477
    {

    }
    if(listitem == 7)//Comet 480
    {

    }
    if(listitem == 8)//Bullet 541
    {

    }
    if(listitem == 9)//jester 559
    {

    }
    }


    Unten im Gamemode:
    stock GiveRandomNeon(vehicleid, playerid)
    {
    switch(random(6))
    {
    case 0: //Blau//hier wenn man Blau anklickt im Dialog wird der Befehl weiter ausgeührt
    {
    SetPVarInt(playerid, "neon", CreateObject(18648,0,0,0,0,0,0,283));
    SetPVarInt(playerid, "neon1", CreateObject(18648,0,0,0,0,0,0,283));
    AttachObjectToVehicle(GetPVarInt(playerid, "neon"), vehicleid, 0.8,0,-0.70,0,0,0);//Hier werden die Neonröhren unter das Auto gemacht also ans auto gehängt das machen wir
    AttachObjectToVehicle(GetPVarInt(playerid, "neon1"), vehicleid, -0.8,0,-0.70,0,0,0);
    HatSchonNeon[playerid] = 1;
    }
    case 1: //Grün
    {
    SetPVarInt(playerid, "neon", CreateObject(18649,0,0,0,0,0,0,283));
    SetPVarInt(playerid, "neon1", CreateObject(18649,0,0,0,0,0,0,283));
    AttachObjectToVehicle(GetPVarInt(playerid, "neon"), vehicleid, 0.8,0,-0.70,0,0,0);
    AttachObjectToVehicle(GetPVarInt(playerid, "neon1"), vehicleid, -0.8,0,-0.70,0,0,0);
    HatSchonNeon[playerid] = 1;
    }
    case 2: //Rot
    {
    SetPVarInt(playerid, "neon", CreateObject(18647,0,0,0,0,0,0,283));
    SetPVarInt(playerid, "neon1", CreateObject(18647,0,0,0,0,0,0,283));
    AttachObjectToVehicle(GetPVarInt(playerid, "neon"), vehicleid, 0.8,0,-0.70,0,0,0);
    AttachObjectToVehicle(GetPVarInt(playerid, "neon1"), vehicleid, -0.8,0,-0.70,0,0,0);
    HatSchonNeon[playerid] = 1;
    }
    case 3: //Weiß
    {
    SetPVarInt(playerid, "neon", CreateObject(18652,0,0,0,0,0,0,283));
    SetPVarInt(playerid, "neon1", CreateObject(18652,0,0,0,0,0,0,283));
    AttachObjectToVehicle(GetPVarInt(playerid, "neon"), vehicleid, 0.8,0,-0.70,0,0,0);
    AttachObjectToVehicle(GetPVarInt(playerid, "neon1"), vehicleid, -0.8,0,-0.70,0,0,0);
    HatSchonNeon[playerid] = 1;
    }
    case 4: //Gelb
    {
    SetPVarInt(playerid, "neon", CreateObject(18650,0,0,0,0,0,0,283));
    SetPVarInt(playerid, "neon1", CreateObject(18650,0,0,0,0,0,0,283));
    AttachObjectToVehicle(GetPVarInt(playerid, "neon"), vehicleid, 0.8,0,-0.70,0,0,0);
    AttachObjectToVehicle(GetPVarInt(playerid, "neon1"), vehicleid, -0.8,0,-0.70,0,0,0);
    HatSchonNeon[playerid] = 1;
    }
    case 5: //Pink
    {
    SetPVarInt(playerid, "neon", CreateObject(18651,0,0,0,0,0,0,283));
    SetPVarInt(playerid, "neon1", CreateObject(18651,0,0,0,0,0,0,283));
    AttachObjectToVehicle(GetPVarInt(playerid, "neon"), vehicleid, 0.8,0,-0.70,0,0,0);
    AttachObjectToVehicle(GetPVarInt(playerid, "neon1"), vehicleid, -0.8,0,-0.70,0,0,0);
    HatSchonNeon[playerid] = 1;
    }
    }
    }


    Es muss dazu gesagt werden, dass dein Neon System natürlich nicht so toll ist, denn jeder Spieler kann nur ein Fahrzeug mit Neon haben, da du die Objekt-IDs in den Spieler-Variablen speicherst.
    Schau mal ob du damit klar kommst. Aber wie gesagt, das ganze System kann ich dir nicht schreiben. Wenn das jemand machen soll, dann wäre das wohl was für den Marktplatz.


    Ich weiß nicht ob deine PlayerCars schon speichern, aber falls nicht, kannst du nach diesem Tutorial vorgehen, ist vom Prinzip her gleich: [ SCRIPTING ] [jTuT] Fraktions-Fahrzeug-System mit MySQL R39-2

  • Jein.
    Du müsstest die Neons auch abhängig von der Vehicle-ID speichern.
    SetPVarInt(playerid, "neon", CreateObject(18651,0,0,0,0,0,0,283));
    zu:
    neon[vehicleid] = CreateObject(18651,0,0,0,0,0,0,283);


    Sodass du es über die vehicleid löschen kannst, wenn das Fahrzeug gelöscht wird.

  • neon[vehicleid] = CreateObject(18648,0,0,0,0,0,0,283));
    neon1[vehicleid] = CreateObject(18648,0,0,0,0,0,0,283));
    AttachObjectToVehicle(GetPVarInt(playerid, "neon"), vehicleid, 0.8,0,-0.70,0,0,0);//Hier werden die Neonröhren unter das Auto gemacht also ans auto gehängt das machen wir
    AttachObjectToVehicle(GetPVarInt(playerid, "neon1"), vehicleid, -0.8,0,-0.70,0,0,0);



    C:\Windows\Vss\First Person\LYD\LYD\gamemodes\LYD.pwn(4537) : error 028: invalid subscript (not an array or too many subscripts): "neon"
    C:\Windows\Vss\First Person\LYD\LYD\gamemodes\LYD.pwn(4537) : warning 215: expression has no effect
    C:\Windows\Vss\First Person\LYD\LYD\gamemodes\LYD.pwn(4537) : error 001: expected token: ";", but found "]"
    C:\Windows\Vss\First Person\LYD\LYD\gamemodes\LYD.pwn(4537) : error 029: invalid expression, assumed zero
    C:\Windows\Vss\First Person\LYD\LYD\gamemodes\LYD.pwn(4537) : fatal error 107: too many error messages on one line


    //E: was vergessen!


    new neon;
    new neon1;


    //E: Fehler ausgebessert!

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • AttachObjectToVehicle(neon(playerid, "neon"), vehicleid, 0.8,0,-0.70,0,0,0);//Hier werden die Neonröhren unter das Auto gemacht also ans auto gehängt das machen wir
    AttachObjectToVehicle(neon1(playerid, "neon1"), vehicleid, -0.8,0,-0.70,0,0,0);


    so hab ich das jetz gemacht nur muss ich noch vehicleid einbaun

  • if(dialogid == DIALOG_GUTSCHEINCARTAKE)
    {
    switch(random(10))
    {
    case 0: //Sultan 560
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new vID = CreateVehicle(560, x, y, z, a, -1, -1, -1);
    PutPlayerInVehicle(playerid, vID, 0);
    GiveRandomNeon(vID, playerid);
    return 1;
    }
    case 1: //Infernus 411
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new vID = CreateVehicle(411, x, y, z, a, -1, -1, -1);
    PutPlayerInVehicle(playerid, vID, 0);
    GiveRandomNeon(vID, playerid);
    return 1;
    }
    case 2: //Turismo 451
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new vID = CreateVehicle(451, x, y, z, a, -1, -1, -1);
    PutPlayerInVehicle(playerid, vID, 0);
    GiveRandomNeon(vID, playerid);
    return 1;
    }
    case 3: //Cheetah 415
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new vID = CreateVehicle(415, x, y, z, a, -1, -1, -1);
    PutPlayerInVehicle(playerid, vID, 0);
    GiveRandomNeon(vID, playerid);
    return 1;
    }
    case 4: //Premiuer 426
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new vID = CreateVehicle(426, x, y, z, a, -1, -1, -1);
    PutPlayerInVehicle(playerid, vID, 0);
    GiveRandomNeon(vID, playerid);
    return 1;
    }
    case 5: //Banshee 429
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new vID = CreateVehicle(429, x, y, z, a, -1, -1, -1);
    PutPlayerInVehicle(playerid, vID, 0);
    GiveRandomNeon(vID, playerid);
    return 1;
    case 6: //Zr350 477
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new vID = CreateVehicle(477, x, y, z, a, -1, -1, -1);
    PutPlayerInVehicle(playerid, vID, 0);
    GiveRandomNeon(vID, playerid);
    return 1;
    case 7: //Comet 480
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new vID = CreateVehicle(480, x, y, z, a, -1, -1, -1);
    PutPlayerInVehicle(playerid, vID, 0);
    GiveRandomNeon(vID, playerid);
    return 1;
    case 8: //Bullet 541
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new vID = CreateVehicle(541, x, y, z, a, -1, -1, -1);
    PutPlayerInVehicle(playerid, vID, 0);
    GiveRandomNeon(vID, playerid);
    return 1;
    case 9: //Jester 559
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new vID = CreateVehicle(559, x, y, z, a, -1, -1, -1);
    PutPlayerInVehicle(playerid, vID, 0);
    GiveRandomNeon(vID, playerid);
    return 1;
    }
    }
    }


    26 Errors?


    //E: Ausgebesser
    //E: //E Hinzugefügt

    2 Mal editiert, zuletzt von DerFamer ()

  • Das liegt möglicherweise daran, dass du anderen Neons in deinem Server ebenso falsch erstellst, sprich über die playerid, und diese nicht gelöscht werden, wenn das Fahrzeug gelöscht wird.
    Oder du löschst die Neons allgemein nicht, wenn ein Fahrzeug gelöscht wird.

  • Ich habe beide jetz so geschreiben wie du sie gesagt hast!


    ZITAT:
    Oder du löschst die Neons allgemein nicht, wenn ein Fahrzeug gelöscht wird.


    Kann auch daran liegen wen ich das Fahrzeug Lösche geht somit auch das Neon nicht weg!


    //E:


    [s]forward GetDtCarOwnerSlot(playerid,veh);
    public GetDtCarOwnerSlot(playerid,veh)
    {
    for(new slot = 0; slot < MaxVeh; slot++)
    {
    if(PlayerCar[playerid][slot][CarId] == veh)
    {
    return slot;
    }
    }
    return 555;
    }
    [/s]
    forward GetDtCarOwner(veh);
    public GetDtCarOwner(veh)
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    for(new X = 0; X < MaxVeh; X++)
    {
    if(PlayerCar[i][X][CarId] == veh){return i;}
    }
    }
    return 1;
    }[/s]

    4 Mal editiert, zuletzt von DerFamer ()

  • So, wie versprochen habe ich mir deinen Gamemode nun angeschaut. Das Neon löschst sich ja jetzt, hast du mir geschrieben.
    Versuche es so, damit das Fahrzeug gespeichert wird:


    So für den Sultan (entsprechend für die anderen):
    case 0: //Sultan 560
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new key = GetFreeKey(playerid);
    if(key == -1) return SendClientMessage(playerid, 0xFF0000FF, "Error: Kein freier Platz.");
    Dtc_PlayerKey[playerid] = key;
    OnPlayerBuyCar2(playerid, 560, x, y, z, a);
    GiveRandomNeon(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], playerid);
    PutPlayerInVehicle(playerid, PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], 0);
    return 1;
    }


    Diese beiden Funktionen unten im Gamemode einfügen:
    stock GetFreeKey(playerid)
    {
    for(new i=0; i<sizeof(Dtc_PlayerHaveCar[]); i++)
    {
    if(!Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]]) return i;
    }
    return -1;
    }


    Function OnPlayerBuyCar2(playerid,Model,Float:x, Float:y, Float:z, Float:a)//CARSYS
    {
    if(IsPlayerConnected(playerid) && !Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]])
    {
    new name[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, name, sizeof name);
    format(str, sizeof str, "/Autos/%s%d.dtcar", name,Dtc_PlayerKey[playerid]);
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_x] = x;
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_y] = y;
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_z] = z;
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarRotate] = a;
    new File: hFile = fopen(str, io_write);
    if (hFile)
    {
    new var[32];
    format(var, 32, "CarId=0\n");fwrite(hFile, var);
    format(var, 32, "CarModel=%d\n",Model);fwrite(hFile, var);
    format(var, 32, "CarPos_x=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_x]);fwrite(hFile, var);
    format(var, 32, "CarPos_y=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_y]);fwrite(hFile, var);
    format(var, 32, "CarPos_z=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_z]);fwrite(hFile, var);
    format(var, 32, "CarRotate=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarRotate]);fwrite(hFile, var);
    format(var, 32, "CarNitro=0\n");fwrite(hFile, var);
    format(var, 32, "CarHyd=0\n");fwrite(hFile, var);
    format(var, 32, "CarWheel=0\n");fwrite(hFile, var);
    format(var, 32, "CarAusp=0\n");fwrite(hFile, var);
    format(var, 32, "CarSideL=0\n");fwrite(hFile, var);
    format(var, 32, "CarSideR=0\n");fwrite(hFile, var);
    format(var, 32, "CarFB=0\n");fwrite(hFile, var);
    format(var, 32, "CarRB=0\n");fwrite(hFile, var);
    format(var, 32, "CarSpoiler=0\n");fwrite(hFile, var);
    format(var, 32, "CarRoof=0\n");fwrite(hFile, var);
    format(var, 32, "CarHood=0\n");fwrite(hFile, var);
    format(var, 32, "CarVents=0\n");fwrite(hFile, var);
    format(var, 32, "CarLamps=0\n");fwrite(hFile, var);
    format(var, 32, "CarPJ=-1\n");fwrite(hFile, var);
    format(var, 32, "CarC1=-1\n");fwrite(hFile, var);
    format(var, 32, "CarC2=-1\n");fwrite(hFile, var);
    format(var, 32, "Preis=0\n");fwrite(hFile, var);
    format(var, 32, "CarArrest=0\n");fwrite(hFile, var);
    format(var, 32, "Plate=[LiS]\n");fwrite(hFile, var);
    fclose(hFile);
    }
    OnPlayerCarLogin(playerid);
    }
    }


    Dann schau mal ob es gespeichert wird.

  • Guten Morgen! Fahrzeugschlüssel wird gespeichert nur das Neon nicht!


    stock GetFreeKey(playerid)
    {
    for(new i=0; i<sizeof(Dtc_PlayerHaveCar[]); i++)
    {
    if(!Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]]) return i;
    }
    return -1;
    }


    Function OnPlayerBuyCar2(playerid,Model,Float:x, Float:y, Float:z, Float:a)//CARSYS
    {
    if(IsPlayerConnected(playerid) && !Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]])
    {
    new name[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, name, sizeof name);
    format(str, sizeof str, "/Autos/%s%d.dtcar", name,Dtc_PlayerKey[playerid]);
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_x] = x;
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_y] = y;
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_z] = z;
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarRotate] = a;
    new File: hFile = fopen(str, io_write);
    if (hFile)
    {
    new var[32];
    format(var, 32, "CarId=0\n");fwrite(hFile, var);
    format(var, 32, "CarModel=%d\n",Model);fwrite(hFile, var);
    format(var, 32, "CarPos_x=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_x]);fwrite(hFile, var);
    format(var, 32, "CarPos_y=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_y]);fwrite(hFile, var);
    format(var, 32, "CarPos_z=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_z]);fwrite(hFile, var);
    format(var, 32, "CarRotate=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarRotate]);fwrite(hFile, var);
    format(var, 32, "CarNitro=0\n");fwrite(hFile, var);
    format(var, 32, "CarHyd=0\n");fwrite(hFile, var);
    format(var, 32, "CarWheel=0\n");fwrite(hFile, var);
    format(var, 32, "CarAusp=0\n");fwrite(hFile, var);
    format(var, 32, "CarSideL=0\n");fwrite(hFile, var);
    format(var, 32, "CarSideR=0\n");fwrite(hFile, var);
    format(var, 32, "CarFB=0\n");fwrite(hFile, var);
    format(var, 32, "CarRB=0\n");fwrite(hFile, var);
    format(var, 32, "CarSpoiler=0\n");fwrite(hFile, var);
    format(var, 32, "CarRoof=0\n");fwrite(hFile, var);
    format(var, 32, "CarHood=0\n");fwrite(hFile, var);
    format(var, 32, "CarVents=0\n");fwrite(hFile, var);
    format(var, 32, "CarLamps=0\n");fwrite(hFile, var);
    format(var, 32, "CarPJ=-1\n");fwrite(hFile, var);
    format(var, 32, "CarC1=-1\n");fwrite(hFile, var);
    format(var, 32, "CarC2=-1\n");fwrite(hFile, var);
    format(var, 32, "Preis=0\n");fwrite(hFile, var);
    format(var, 32, "CarArrest=0\n");fwrite(hFile, var);
    format(var, 32, "Plate=[LiS]\n");fwrite(hFile, var);
    fclose(hFile);
    }
    OnPlayerCarLogin(playerid);
    }
    }


    if(dialogid == DIALOG_GUTSCHEINCARTAKE)
    {
    switch(random(7))
    {
    case 0: //Sultan 560
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new key = GetFreeKey(playerid);
    if(key == -1) return SendClientMessage(playerid, 0xFF0000FF, "Error: Kein freier Platz.");
    Dtc_PlayerKey[playerid] = key;
    OnPlayerBuyCar2(playerid, 560, x, y, z, a);
    GiveRandomNeon(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], playerid);
    PutPlayerInVehicle(playerid, PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], 0);
    return 1;
    }
    case 1: //Infernus 411
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new key = GetFreeKey(playerid);
    if(key == -1) return SendClientMessage(playerid, 0xFF0000FF, "Error: Kein freier Platz.");
    Dtc_PlayerKey[playerid] = key;
    OnPlayerBuyCar2(playerid, 411, x, y, z, a);
    GiveRandomNeon(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], playerid);
    PutPlayerInVehicle(playerid, PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], 0);
    return 1;
    }
    case 2: //Turismo 451
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new key = GetFreeKey(playerid);
    if(key == -1) return SendClientMessage(playerid, 0xFF0000FF, "Error: Kein freier Platz.");
    Dtc_PlayerKey[playerid] = key;
    OnPlayerBuyCar2(playerid, 451, x, y, z, a);
    GiveRandomNeon(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], playerid);
    PutPlayerInVehicle(playerid, PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], 0);
    return 1;
    }
    case 3: //Cheetah 415
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new key = GetFreeKey(playerid);
    if(key == -1) return SendClientMessage(playerid, 0xFF0000FF, "Error: Kein freier Platz.");
    Dtc_PlayerKey[playerid] = key;
    OnPlayerBuyCar2(playerid, 415, x, y, z, a);
    GiveRandomNeon(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], playerid);
    PutPlayerInVehicle(playerid, PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], 0);
    return 1;
    }
    case 4: //Zr350 477
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new key = GetFreeKey(playerid);
    if(key == -1) return SendClientMessage(playerid, 0xFF0000FF, "Error: Kein freier Platz.");
    Dtc_PlayerKey[playerid] = key;
    OnPlayerBuyCar2(playerid, 477, x, y, z, a);
    GiveRandomNeon(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], playerid);
    PutPlayerInVehicle(playerid, PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], 0);
    return 1;
    }
    case 5: //Bullet 541
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new key = GetFreeKey(playerid);
    if(key == -1) return SendClientMessage(playerid, 0xFF0000FF, "Error: Kein freier Platz.");
    Dtc_PlayerKey[playerid] = key;
    OnPlayerBuyCar2(playerid, 541, x, y, z, a);
    GiveRandomNeon(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], playerid);
    PutPlayerInVehicle(playerid, PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], 0);
    return 1;
    }
    case 6: //Jester 559
    {
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    new key = GetFreeKey(playerid);
    if(key == -1) return SendClientMessage(playerid, 0xFF0000FF, "Error: Kein freier Platz.");
    Dtc_PlayerKey[playerid] = key;
    OnPlayerBuyCar2(playerid, 559, x, y, z, a);
    GiveRandomNeon(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], playerid);
    PutPlayerInVehicle(playerid, PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], 0);
    return 1;
    }
    }
    }

  • Alles klar. Ja, das Neon hatte ich noch nicht hinzugefügt, da ich zuerst wissen wollte ob das so klappt.
    Ändere diese Funktionen jeweils zu:

    Spoiler anzeigen
    stock GiveRandomNeon(vehicleid, playerid)
    {
    return GiveNeon(vehicleid, playerid, random(6));
    }

    Spoiler anzeigen
    stock GiveNeon(vehicleid, playerid, neon)
    {
    switch(neon)
    {
    case 0: //Blau//hier wenn man Blau anklickt im Dialog wird der Befehl weiter ausgeührt
    {
    neon[vehicleid] = CreateObject(18648,0,0,0,0,0,0,283);
    neon1[vehicleid] = CreateObject(18648,0,0,0,0,0,0,283);
    AttachObjectToVehicle(neon[vehicleid], vehicleid, 0.8,0,-0.70,0,0,0);//Hier werden die Neonröhren unter das Auto gemacht also ans auto gehängt das machen wir
    AttachObjectToVehicle(neon1[vehicleid], vehicleid, -0.8,0,-0.70,0,0,0);
    HatSchonNeon[playerid] = 1;
    }
    case 1: //Grün
    {
    neon[vehicleid] = CreateObject(18649,0,0,0,0,0,0,283);
    neon1[vehicleid] = CreateObject(18649,0,0,0,0,0,0,283);
    AttachObjectToVehicle(neon[vehicleid], vehicleid, 0.8,0,-0.70,0,0,0);
    AttachObjectToVehicle(neon1[vehicleid], vehicleid, -0.8,0,-0.70,0,0,0);
    HatSchonNeon[playerid] = 1;
    }
    case 2: //Rot
    {
    neon[vehicleid] = CreateObject(18647,0,0,0,0,0,0,283);
    neon1[vehicleid] = CreateObject(18647,0,0,0,0,0,0,283);
    AttachObjectToVehicle(neon[vehicleid], vehicleid, 0.8,0,-0.70,0,0,0);
    AttachObjectToVehicle(neon1[vehicleid], vehicleid, -0.8,0,-0.70,0,0,0);
    HatSchonNeon[playerid] = 1;
    }
    case 3: //Weiß
    {
    neon[vehicleid] = CreateObject(18652,0,0,0,0,0,0,283);
    neon1[vehicleid] = CreateObject(18652,0,0,0,0,0,0,283);
    AttachObjectToVehicle(neon[vehicleid], vehicleid, 0.8,0,-0.70,0,0,0);
    AttachObjectToVehicle(neon1[vehicleid], vehicleid, -0.8,0,-0.70,0,0,0);
    HatSchonNeon[playerid] = 1;
    }
    case 4: //Gelb
    {
    neon[vehicleid] = CreateObject(18650,0,0,0,0,0,0,283);
    neon1[vehicleid] = CreateObject(18650,0,0,0,0,0,0,283);
    AttachObjectToVehicle(neon[vehicleid], vehicleid, 0.8,0,-0.70,0,0,0);
    AttachObjectToVehicle(neon1[vehicleid], vehicleid, -0.8,0,-0.70,0,0,0);
    HatSchonNeon[playerid] = 1;
    }
    case 5: //Pink
    {
    neon[vehicleid] = CreateObject(18651,0,0,0,0,0,0,283);
    neon1[vehicleid] = CreateObject(18651,0,0,0,0,0,0,283);
    AttachObjectToVehicle(neon[vehicleid], vehicleid, 0.8,0,-0.70,0,0,0);
    AttachObjectToVehicle(neon1[vehicleid], vehicleid, -0.8,0,-0.70,0,0,0);
    HatSchonNeon[playerid] = 1;
    }
    }
    return neon;
    }
    Function OnPlayerBuyCar2(playerid,Model,Float:x, Float:y, Float:z, Float:a)//CARSYS
    {
    if(IsPlayerConnected(playerid) && !Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]])
    {
    new name[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, name, sizeof name);
    format(str, sizeof str, "/Autos/%s%d.dtcar", name,Dtc_PlayerKey[playerid]);
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_x] = x;
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_y] = y;
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_z] = z;
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarRotate] = a;
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][NeonID] = -1;
    new File: hFile = fopen(str, io_write);
    if (hFile)
    {
    new var[32];
    format(var, 32, "CarId=0\n");fwrite(hFile, var);
    format(var, 32, "CarModel=%d\n",Model);fwrite(hFile, var);
    format(var, 32, "CarPos_x=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_x]);fwrite(hFile, var);
    format(var, 32, "CarPos_y=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_y]);fwrite(hFile, var);
    format(var, 32, "CarPos_z=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_z]);fwrite(hFile, var);
    format(var, 32, "CarRotate=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarRotate]);fwrite(hFile, var);
    format(var, 32, "CarNitro=0\n");fwrite(hFile, var);
    format(var, 32, "CarHyd=0\n");fwrite(hFile, var);
    format(var, 32, "CarWheel=0\n");fwrite(hFile, var);
    format(var, 32, "CarAusp=0\n");fwrite(hFile, var);
    format(var, 32, "CarSideL=0\n");fwrite(hFile, var);
    format(var, 32, "CarSideR=0\n");fwrite(hFile, var);
    format(var, 32, "CarFB=0\n");fwrite(hFile, var);
    format(var, 32, "CarRB=0\n");fwrite(hFile, var);
    format(var, 32, "CarSpoiler=0\n");fwrite(hFile, var);
    format(var, 32, "CarRoof=0\n");fwrite(hFile, var);
    format(var, 32, "CarHood=0\n");fwrite(hFile, var);
    format(var, 32, "CarVents=0\n");fwrite(hFile, var);
    format(var, 32, "CarLamps=0\n");fwrite(hFile, var);
    format(var, 32, "CarPJ=-1\n");fwrite(hFile, var);
    format(var, 32, "CarC1=-1\n");fwrite(hFile, var);
    format(var, 32, "CarC2=-1\n");fwrite(hFile, var);
    format(var, 32, "Preis=0\n");fwrite(hFile, var);
    format(var, 32, "CarArrest=0\n");fwrite(hFile, var);
    format(var, 32, "Plate=[LiS]\n");fwrite(hFile, var);
    format(var, 32, "NeonID=-1\n");fwrite(hFile, var);
    fclose(hFile);
    }
    OnPlayerCarLogin(playerid);
    }
    }
    Function OnPlayerBuyCar(playerid,Model,Preis,Autohaus)//CARSYS
    {
    if(IsPlayerConnected(playerid) && !Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]])
    {
    CallRemoteFunction("M_GivePlayerMoney","id",playerid,-Preis);
    if(Autohaus == 2) //Billig Autohaus
    {
    SBizzInfo[1][sbTill] += Preis/4; //Billig Autohaus
    }
    if(Autohaus == 3) // luxus
    {
    SBizzInfo[0][sbTill] += Preis/4; // luxus
    }
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "*Du hast dir ein Auto gekauft.");

    Spoiler anzeigen
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "*Gehe zu der KFZ Stelle und hole dir ein Kennzeichen.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "*Fahre vorsichtig..Und denk an die StraßenVerkehrsOrdnung!");
    SendClientMessage(playerid,COLOR_GRAD2,"Navigation gesetzt!");
    SetParkPlatz(playerid,Autohaus);
    new name[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, name, sizeof name);
    format(str, sizeof str, "/Autos/%s%d.dtcar", name,Dtc_PlayerKey[playerid]);
    new File: hFile = fopen(str, io_write);
    if (hFile)
    {
    new var[32];
    format(var, 32, "CarId=0\n");fwrite(hFile, var);
    format(var, 32, "CarModel=%d\n",Model);fwrite(hFile, var);
    format(var, 32, "CarPos_x=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_x]);fwrite(hFile, var);
    format(var, 32, "CarPos_y=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_y]);fwrite(hFile, var);
    format(var, 32, "CarPos_z=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_z]);fwrite(hFile, var);
    format(var, 32, "CarRotate=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarRotate]);fwrite(hFile, var);
    format(var, 32, "CarNitro=0\n");fwrite(hFile, var);
    format(var, 32, "CarHyd=0\n");fwrite(hFile, var);
    format(var, 32, "CarWheel=0\n");fwrite(hFile, var);
    format(var, 32, "CarAusp=0\n");fwrite(hFile, var);
    format(var, 32, "CarSideL=0\n");fwrite(hFile, var);
    format(var, 32, "CarSideR=0\n");fwrite(hFile, var);
    format(var, 32, "CarFB=0\n");fwrite(hFile, var);
    format(var, 32, "CarRB=0\n");fwrite(hFile, var);
    format(var, 32, "CarSpoiler=0\n");fwrite(hFile, var);
    format(var, 32, "CarRoof=0\n");fwrite(hFile, var);
    format(var, 32, "CarHood=0\n");fwrite(hFile, var);
    format(var, 32, "CarVents=0\n");fwrite(hFile, var);
    format(var, 32, "CarLamps=0\n");fwrite(hFile, var);
    format(var, 32, "CarPJ=-1\n");fwrite(hFile, var);
    format(var, 32, "CarC1=-1\n");fwrite(hFile, var);
    format(var, 32, "CarC2=-1\n");fwrite(hFile, var);
    format(var, 32, "Preis=%d\n",Preis);fwrite(hFile, var);
    format(var, 32, "CarArrest=0\n");fwrite(hFile, var);
    format(var, 32, "Plate=[LiS]\n");fwrite(hFile, var);
    format(var, 32, "NeonID=-1\n");fwrite(hFile, var);
    fclose(hFile);
    }
    OnPlayerCarLogin(playerid);
    }
    }
    Function OnPlayerCarLogin(playerid)
    {
    for(new x = 0; x < MaxVeh; x++)
    {
    if(!Dtc_PlayerHaveCar[playerid][x])
    {
    new string2[128];
    new playername2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    format(string2, sizeof(string2), "/Autos/%s%d.dtcar", playername2,x);
    new File: UserFile = fopen(string2, io_read);
    if (UserFile)
    {
    Dtc_PlayerHaveCar[playerid][x] = 1;
    new key[ 256 ] , val[ 256 ];
    new Data[ 256 ];
    while ( fread( UserFile , Data , sizeof( Data ) ) )
    {
    key = ini_GetKey( Data );
    if( strcmp( key , "CarId" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarId] = strval( val ); }
    if( strcmp( key , "CarModel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarModel] = strval( val ); }
    if( strcmp( key , "CarPos_x" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPos_x] = floatstr( val ); }
    if( strcmp( key , "CarPos_y" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPos_y] = floatstr( val ); }
    if( strcmp( key , "CarPos_z" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPos_z] = floatstr( val ); }
    if( strcmp( key , "CarRotate" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarRotate] = floatstr( val ); }
    if( strcmp( key , "CarNitro" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarNitro] = strval( val ); }
    if( strcmp( key , "CarHyd" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarHyd] = strval( val ); }
    if( strcmp( key , "CarWheel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarWheel] = strval( val ); }
    if( strcmp( key , "CarAusp" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarAusp] = strval( val ); }
    if( strcmp( key , "CarSideL" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarSideL] = strval( val ); }
    if( strcmp( key , "CarSideR" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarSideR] = strval( val ); }
    if( strcmp( key , "CarFB" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarFB] = strval( val ); }
    if( strcmp( key , "CarRB" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarRB] = strval( val ); }
    if( strcmp( key , "CarSpoiler" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarSpoiler] = strval( val ); }
    if( strcmp( key , "CarRoof" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarRoof] = strval( val ); }
    if( strcmp( key , "CarHood" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarHood] = strval( val ); }
    if( strcmp( key , "CarVents" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarVents] = strval( val ); }
    if( strcmp( key , "CarLamps" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarLamps] = strval( val ); }
    if( strcmp( key , "CarPJ" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPJ] = strval( val ); }
    if( strcmp( key , "CarC1" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarC1] = strval( val ); }
    if( strcmp( key , "CarC2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarC2] = strval( val ); }
    if( strcmp( key , "Preis" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPreis] = strval( val ); }
    if( strcmp( key , "CarArrest" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarArrest] = strval( val ); }
    if( strcmp( key , "Plate" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][Plate] = strval( val ); }
    if( strcmp( key , "NeonID" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][NeonID] = strval( val ); }
    }
    fclose(UserFile);
    PlayerCarSpawn(playerid,x);
    }
    }
    }
    }
    Function PlayerCarSpawn(playerid,Slot)
    {
    if(IsPlayerConnected(playerid))
    {
    if(Dtc_PlayerHaveCar[playerid][Slot])
    {
    PlayerCar[playerid][Slot][CarId] = CreateVehicle(PlayerCar[playerid][Slot][CarModel],PlayerCar[playerid][Slot][CarPos_x],PlayerCar[playerid][Slot][CarPos_y],PlayerCar[playerid][Slot][CarPos_z],PlayerCar[playerid][Slot][CarRotate],PlayerCar[playerid][Slot][CarC1],PlayerCar[playerid][Slot][CarC2], 60000);/*vehicle spawn*/
    GiveNeon(PlayerCar[playerid][Slot][CarId], playerid);
    ChangeVehicleColor(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarC1],PlayerCar[playerid][Slot][CarC2]);
    if(PlayerCar[playerid][Slot][CarPJ] >= 0) {ChangeVehiclePaintjob(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarPJ]);}
    if(PlayerCar[playerid][Slot][CarNitro] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarNitro]);}
    if(PlayerCar[playerid][Slot][CarHyd] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarHyd]);}
    if(PlayerCar[playerid][Slot][CarWheel] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarWheel]);}
    if(PlayerCar[playerid][Slot][CarAusp] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarAusp]);}
    if(PlayerCar[playerid][Slot][CarSideL] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarSideL]);}
    if(PlayerCar[playerid][Slot][CarSideR] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarSideR]);}
    if(PlayerCar[playerid][Slot][CarFB] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarFB]);}
    if(PlayerCar[playerid][Slot][CarRB] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarRB]);}
    if(PlayerCar[playerid][Slot][CarSpoiler] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarSpoiler]);}
    if(PlayerCar[playerid][Slot][CarRoof] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarRoof]);}
    if(PlayerCar[playerid][Slot][CarHood] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarHood]);}
    if(PlayerCar[playerid][Slot][CarVents] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarVents]);}
    if(PlayerCar[playerid][Slot][CarLamps] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarLamps]);}
    if(Dtc_LockOnSpawn)
    {
    Dtc_Carlock[PlayerCar[playerid][Slot][CarId]] = 1;
    Dtc_LockCar(PlayerCar[playerid][Slot][CarId]);
    }
    new strings[15];
    new name[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, name, sizeof name);
    format(str, sizeof str, "/Autos/%s%d.dtcar", name,Dtc_PlayerKey[playerid]);
    //format(strings, sizeof(strings), "%s", dini_Get(str, "CarPlate"));
    format(strings, sizeof(strings), "%s", dini_Get(str, "Plate"));
    SetVehicleNumberPlate(PlayerCar[playerid][Slot][CarId], strings);
    SetVehicleToRespawn(PlayerCar[playerid][Slot][CarId]);
    for(new x = 0; x < MaxVeh; x++)
    {
    PlayerCar[playerid][x][Plate] = strings;
    }
    }
    }
    }
    Function OnPlayerCarUpdate(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    for(new x = 0; x < MaxVeh; x++)
    {
    if(Dtc_PlayerHaveCar[playerid][x])
    {
    DestroyVehicle(PlayerCar[playerid][x][CarId]);
    Dtc_Carlock[PlayerCar[playerid][x][CarId]] = 0;
    Dtc_LockCar(PlayerCar[playerid][x][CarId]);
    new string3[128];
    new playername3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername3, sizeof(playername3));
    format(string3, sizeof(string3), "/Autos/%s%d.dtcar", playername3,x);
    new File: hFile = fopen(string3, io_write);
    if (hFile)
    {
    new var[32];
    format(var, 32, "CarId=%d\n",PlayerCar[playerid][x][CarId]);fwrite(hFile, var);
    format(var, 32, "CarModel=%d\n",PlayerCar[playerid][x][CarModel]);fwrite(hFile, var);
    format(var, 32, "CarPos_x=%.3f\n",PlayerCar[playerid][x][CarPos_x]);fwrite(hFile, var);
    format(var, 32, "CarPos_y=%.3f\n",PlayerCar[playerid][x][CarPos_y]);fwrite(hFile, var);
    format(var, 32, "CarPos_z=%.3f\n",PlayerCar[playerid][x][CarPos_z]);fwrite(hFile, var);
    format(var, 32, "CarRotate=%.3f\n",PlayerCar[playerid][x][CarRotate]);fwrite(hFile, var);
    format(var, 32, "CarNitro=%d\n",PlayerCar[playerid][x][CarNitro]);fwrite(hFile, var);
    format(var, 32, "CarHyd=%d\n",PlayerCar[playerid][x][CarHyd]);fwrite(hFile, var);
    format(var, 32, "CarWheel=%d\n",PlayerCar[playerid][x][CarWheel]);fwrite(hFile, var);
    format(var, 32, "CarAusp=%d\n",PlayerCar[playerid][x][CarAusp]);fwrite(hFile, var);
    format(var, 32, "CarSideL=%d\n",PlayerCar[playerid][x][CarSideL]);fwrite(hFile, var);
    format(var, 32, "CarSideR=%d\n",PlayerCar[playerid][x][CarSideR]);fwrite(hFile, var);
    format(var, 32, "CarFB=%d\n",PlayerCar[playerid][x][CarFB]);fwrite(hFile, var);
    format(var, 32, "CarRB=%d\n",PlayerCar[playerid][x][CarRB]);fwrite(hFile, var);
    format(var, 32, "CarSpoiler=%d\n",PlayerCar[playerid][x][CarSpoiler]);fwrite(hFile, var);
    format(var, 32, "CarRoof=%d\n",PlayerCar[playerid][x][CarRoof]);fwrite(hFile, var);
    format(var, 32, "CarHood=%d\n",PlayerCar[playerid][x][CarHood]);fwrite(hFile, var);
    format(var, 32, "CarVents=%d\n",PlayerCar[playerid][x][CarVents]);fwrite(hFile, var);
    format(var, 32, "CarLamps=%d\n",PlayerCar[playerid][x][CarLamps]);fwrite(hFile, var);
    format(var, 32, "CarPJ=%d\n",PlayerCar[playerid][x][CarPJ]);fwrite(hFile, var);
    format(var, 32, "CarC1=%d\n",PlayerCar[playerid][x][CarC1]);fwrite(hFile, var);
    format(var, 32, "CarC2=%d\n",PlayerCar[playerid][x][CarC2]);fwrite(hFile, var);
    format(var, 32, "Preis=%d\n",PlayerCar[playerid][x][CarPreis]);fwrite(hFile, var);
    format(var, 32, "CarArrest=%d\n",PlayerCar[playerid][x][CarArrest]);fwrite(hFile, var);
    format(var, 32, "Plate=%s\n",PlayerCar[playerid][x][Plate]);fwrite(hFile, var);
    format(var, 32, "NeonID=%d\n",PlayerCar[playerid][x][NeonID]);fwrite(hFile, var);
    fclose(hFile);
    }
    }
    }
    }
    }

    Die GiveNeon fügst du hinzu.


    Außerdem, beim Gutschein:
    GiveRandomNeon(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], playerid);
    zu:
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][NeonID] = GiveRandomNeon(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], playerid);
    OnPlayerCarUpdate(playerid);

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen