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
  • C:\Windows\Vss\First Person\GRZ-Dome\German-Black-Reallife\gamemodes\German-Black-Reallife.pwn(4531) : warning 219: local variable "neon" shadows a variable at a preceding level
    C:\Windows\Vss\First Person\GRZ-Dome\German-Black-Reallife\gamemodes\German-Black-Reallife.pwn(4537) : error 028: invalid subscript (not an array or too many subscripts): "neon"
    C:\Windows\Vss\First Person\GRZ-Dome\German-Black-Reallife\gamemodes\German-Black-Reallife.pwn(4537) : warning 215: expression has no effect
    C:\Windows\Vss\First Person\GRZ-Dome\German-Black-Reallife\gamemodes\German-Black-Reallife.pwn(4537) : error 001: expected token: ";", but found "]"
    C:\Windows\Vss\First Person\GRZ-Dome\German-Black-Reallife\gamemodes\German-Black-Reallife.pwn(4537) : error 029: invalid expression, assumed zero


    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;
    }

  • Sorry, mein Fehler, der Parameter heißt ja gleich wie dein Array.
    Schreibe es so:
    stock GiveNeon(vehicleid, playerid, neonid)
    {
    switch(neonid)
    {
    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 neonid;
    }

    3HZXdYd.png

    Einmal editiert, zuletzt von Jeffry ()

  • C:\Windows\Vss\First Person\GRZ-Dome\German-Black-Reallife\gamemodes\German-Black-Reallife.pwn(4530) : error 079: inconsistent return types (array & non-array)
    C:\Windows\Vss\First Person\GRZ-Dome\German-Black-Reallife\gamemodes\German-Black-Reallife.pwn(56380) : error 006: must be assigned to an array
    C:\Windows\Vss\First Person\GRZ-Dome\German-Black-Reallife\gamemodes\German-Black-Reallife.pwn(56394) : error 006: must be assigned to an array
    C:\Windows\Vss\First Person\GRZ-Dome\German-Black-Reallife\gamemodes\German-Black-Reallife.pwn(56408) : error 006: must be assigned to an array
    C:\Windows\Vss\First Person\GRZ-Dome\German-Black-Reallife\gamemodes\German-Black-Reallife.pwn(56422) : error 006: must be assigned to an array
    C:\Windows\Vss\First Person\GRZ-Dome\German-Black-Reallife\gamemodes\German-Black-Reallife.pwn(56436) : error 006: must be assigned to an array
    C:\Windows\Vss\First Person\GRZ-Dome\German-Black-Reallife\gamemodes\German-Black-Reallife.pwn(56450) : error 006: must be assigned to an array
    C:\Windows\Vss\First Person\GRZ-Dome\German-Black-Reallife\gamemodes\German-Black-Reallife.pwn(56464) : error 006: must be assigned to an array
    C:\Windows\Vss\First Person\GRZ-Dome\German-Black-Reallife\gamemodes\German-Black-Reallife.pwn(64173) : warning 202: number of arguments does not match definition


    //E:
    Das mit NeonID hab ich behoben
    //E: Rechtschreibfehler ausgebessert


    lol?

  • Du hast NeonID nicht im enum zu CarInfo deklariert, das musst du noch machen.
    In der Funktion habe ich nochmal was ausgebessert, kopiere sie nochmal:

    Spoiler anzeigen
    stock GiveNeon(vehicleid, playerid, neonid)
    {
    switch(neonid)
    {
    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 neonid;
    }

  • C:\Windows\Vss\First Person\GRZ-Dome\German-Black-Reallife\gamemodes\German-Black-Reallife.pwn(64173) : warning 202: number of arguments does not match Definition


    GiveNeon(PlayerCar[playerid][Slot][CarId], playerid); //Warning


    //E:
    In Pawno gesetzt

  • 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;
    }
    }
    }
    }

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


    stock GiveNeon(vehicleid, playerid, neonid)
    {
    switch(neonid)
    {
    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 neonid;
    }


    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.");


    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, PlayerCar[playerid][Slot][NeonID]);
    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);
    }
    }
    }
    }
    }


    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);
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][NeonID] = GiveRandomNeon(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], playerid);
    OnPlayerCarUpdate(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);
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][NeonID] = GiveRandomNeon(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], playerid);
    OnPlayerCarUpdate(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);
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][NeonID] = GiveRandomNeon(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], playerid);
    OnPlayerCarUpdate(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);
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][NeonID] = GiveRandomNeon(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], playerid);
    OnPlayerCarUpdate(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);
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][NeonID] = GiveRandomNeon(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], playerid);
    OnPlayerCarUpdate(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);
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][NeonID] = GiveRandomNeon(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], playerid);
    OnPlayerCarUpdate(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);
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][NeonID] = GiveRandomNeon(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], playerid);
    OnPlayerCarUpdate(playerid);
    PutPlayerInVehicle(playerid, PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId], 0);
    return 1;
    }
    }
    }


    ocmd:gutschein(playerid, params[])
    {
    if(!params[0]) return SendClientMessage(playerid, 0xFF0000FF, "/gutschein [Code]");
    new code[40];
    format(code, sizeof(code), "/codes/%s.txt", params);
    if(!fexist(code)) return SendClientMessage(playerid, 0xFF0000FF, "Code existiert nicht.");
    new typ = dini_Int(code, "typ");
    new wert = dini_Int(code, "wert");
    new str[50];
    switch(typ)
    {
    case 1:
    {
    GivePlayerMoney(playerid, wert);
    format(str,sizeof(str),"Code eingelöst: %i$ bekommen.",wert);
    SendClientMessage(playerid,-1,str);
    }
    case 2:
    {
    PlayerInfo[playerid][pExp] = wert;
    format(str,sizeof(str),"Code eingelöst: %i Respektpunkte bekommen.",wert);
    SendClientMessage(playerid,-1,str);
    }
    case 3:
    {
    PlayerInfo[playerid][pDonateRank] = wert;
    format(str,sizeof(str),"Code eingelöst: Du hast Premium Level %i bekommen.",wert);
    SendClientMessage(playerid,-1,str);
    }
    case 4:
    {
    PlayerInfo[playerid][pAllowNeon] = 1;
    SendClientMessage(playerid,-1,"Code eingelöst: Du hast einen Neon Gutschein eingelöst.");
    SendClientMessage(playerid,-1,"Fahre zum NeonShop um dir Neon an dein Auto zu bauen.");
    ShowPlayerDialog(playerid, DIALOG_GUTSCHEINCARTAKE, DIALOG_STYLE_LIST, "Autoauswahl - Gutscheinsystem","~>~ Neon Fahrzeug ~<~\n","Auswählen", "Schlissen");
    }
    }
    fremove(code);
    return 1;
    }


    ocmd:creategutschein(playerid, params[])
    {
    if(PlayerInfo[playerid][pAdmin] <= 7)
    {
    new typ, wert;
    if(sscanf(params,"ii",typ,wert))return SendClientMessage(playerid, 0xFF0000FF, "/createcode [Typ] [Wert]");
    if(sscanf(params,"ii",typ,wert))return SendClientMessage(playerid, 0xFF0000FF, "1 = Geld | 2 = Respektpunkte | 3 = Premium | 4 = UBB Fahrzeug");
    if(typ < 1 || typ > 4)return SendClientMessage(playerid,-1,"Bitte wähle einen Typ aus von 1-4");
    if(wert < 1 || wert > 1000000) return SendClientMessage(playerid,-1,"Wert bitte nur von 1 - 1Mio.");
    new code[40], str[145];
    format(code, sizeof(code), "%04d-%04d-%04d-%04d", random(10000), random(10000), random(10000), random(10000));
    format(str, sizeof(str), "Gutscheincode : %s",code);
    SendClientMessage(playerid,ROT,str);
    format(code, sizeof(code), "/codes/%s.txt", code);
    dini_Create(code);
    dini_IntSet(code, "typ", typ);
    dini_IntSet(code, "wert", wert);
    }
    else
    {
    SendClientMessage(playerid, 0xFF0000FF, "Du hast kein Adminlevel 7");
    }
    return 1;
    }


    Das sind die Bisherigen Funktionen!

  • Spoiler anzeigen
    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);
    }
    printf("Fahrzeug-Datei Slot %d erstellt: %d / %f / %f / %f", Dtc_PlayerKey[playerid], Model, x, y, z);
    OnPlayerCarLogin(playerid);
    }
    }

    Spoiler anzeigen
    Function OnPlayerCarLogin(playerid)
    {
    printf("OnPlayerCarLogin...");
    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);
    printf("Fahrzeug-Slot %d geladen: Model: %d", x, PlayerCar[playerid][x][CarModel]);
    PlayerCarSpawn(playerid,x);
    }
    }
    }
    }

    Spoiler anzeigen
    Function PlayerCarSpawn(playerid,Slot)
    {
    printf("PlayerCarSpawn...");
    if(IsPlayerConnected(playerid))
    {
    if(Dtc_PlayerHaveCar[playerid][Slot])
    {
    printf("Hat Fahrzeug in Slot %d", 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*/
    printf("Fahrzeug Slot %d erstellt: %d / %f / %f / %f", Slot, PlayerCar[playerid][Slot][CarModel],PlayerCar[playerid][Slot][CarPos_x],PlayerCar[playerid][Slot][CarPos_y],PlayerCar[playerid][Slot][CarPos_z]);
    GiveNeon(PlayerCar[playerid][Slot][CarId], playerid, PlayerCar[playerid][Slot][NeonID]);
    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;
    }
    printf("Vehicle-ID %d erfolgreich erstellt.", PlayerCar[playerid][Slot][CarId]);
    }
    }
    }


    Schreibe die Funktionen mal so und teste es dann nochmal. Dann poste bitte was im Server Log steht, wenn du ein Fahrzeug per Gutschein gekauft hast.

  • [08:31:28] OnPlayerCarLogin...
    [08:32:15] Fahrzeug-Datei Slot 0 erstellt: 415 / 1463.826538 / -898.684082 / 54.835937
    [08:32:15] OnPlayerCarLogin...
    [08:32:15] Fahrzeug-Slot 0 geladen: Model: 415
    [08:32:15] PlayerCarSpawn...
    [08:32:15] Hat Fahrzeug in Slot 0
    [08:32:15] Fahrzeug Slot 0 erstellt: 415 / 1463.826049 / -898.684020 / 54.834999
    [08:32:15] Vehicle-ID 429 erfolgreich erstellt.

  • Also laut Debug wird alles korrekt gespeichert und geladen. Das Fahrzeug wird auch erstellt.
    Hast du einen Befehl, mit dem du dich zu einem Fahrzeug teleportieren kannst? Wenn ja, teleportiere dich mal zu der 429 (oder das was eben im letzten print dann steht), und schau wo das Fahrzeug ist.

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