| Carkey - Problem (ERROR) |

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
  • 3 = Anzahl die man standardmäßig haben kann. Das ... einfach so lassen.


    Ich bekomme jetzt die meldung das ich schon 1 Fahrzeug besitze.



    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid == DIALOG_AUTOKAUFEN)
    {
    if(response == 1)
    {
    new string[128];
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    if (Spectating[playerid][0]!=-1)
    {
    if (Carlist[playerid][s][Typ]==-1)
    {
    new preis = Kaufliste[Spectating[playerid][0]][Preis];
    if(Spectating[playerid][0] == -1)
    {
    //Motorhaube zu
    new vid = GetPlayerVehicleID(playerid);
    new engine,lights1,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
    //Kofferraum zu
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
    //Licht aus
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
    SendClientMessage(playerid, COLOR_GRAD1, "Du besichtigst kein Fahrzeug!");
    TogglePlayerControllable(playerid,1);
    SetVehicleParamsForAll(Kaufliste[Spectating[playerid][0]][Carid],0,0);
    Spectating[playerid][0]=-1;
    RemovePlayerFromVehicle(playerid);
    }
    else if (preis <= GetPlayerMoney(playerid))
    {
    new autohaus=Kaufliste[Spectating[playerid][0]][Autohaus];
    //Motorhaube zu
    new vid = GetPlayerVehicleID(playerid);
    new engine,lights1,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
    //Kofferraum zu
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
    //Licht aus
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);


    GivePlayerMoney(playerid, - preis);
    Carlist[playerid][s][Typ]=Spectating[playerid][0]; Carlist[playerid][s][X]=Autospawns[autohaus][X]; Carlist[playerid][s][Y]=Autospawns[autohaus][Y];
    Carlist[playerid][s][Z]=Autospawns[autohaus][Z]; Carlist[playerid][s][Rotation]=Autospawns[autohaus][Rotation]; Carlist[playerid][s][Status]=1; Carlist[playerid][s][Lock]=0;
    Carlist[playerid][s][Carid]=CreateVehicle(Kaufliste[Spectating[playerid][0]][Modelid],Carlist[playerid][s][X],Carlist[playerid][s][Y],Carlist[playerid][s][Z],Carlist[playerid][s][Rotation],-1,-1,-1);
    SetVehicleParamsForAll(Kaufliste[Spectating[playerid][0]][Carid],0,0);
    TogglePlayerControllable(playerid,1);
    Spectating[playerid][0]=-1;
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_WHITE, " ");
    format(string,128,"Du hast dir erfolgreich für $%i das Fahrzeug %s gekauft.",preis,Kaufliste[Carlist[playerid][s][Typ]][Name]);
    SendClientMessage(playerid, COLOR_GREEN, string);
    SendClientMessage(playerid, COLOR_YELLOW, "* Wenn dein Fahrzeug zerstört ist, gib /freparieren ein um es zu reparieren.");
    SendClientMessage(playerid, COLOR_YELLOW, "* Du kannst dein Fahrzeug mit /flock, auf- und abschließen.");
    SendClientMessage(playerid, COLOR_YELLOW, "* Mehr Befehle kannst du unter /fahrzeughelp sehen.");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_GREEN, "Dein Fahrzeug steht nun am Ausgabepunkt bereit! Viel Spaß mit dein neuen Fahrzeug");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_GREEN, "Fahr Vorsichtig!");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    }
    else
    {
    //Motorhaube zu
    new vid = GetPlayerVehicleID(playerid);
    new engine,lights1,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
    //Kofferraum zu
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
    //Licht aus
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);


    format(string, 128, "Du hast nicht keine $%i um das Fahrzeug zu kaufen.", preis); SendClientMessage(playerid, COLOR_GRAD1, string);
    TogglePlayerControllable(playerid,1);
    SetVehicleParamsForAll(Kaufliste[Spectating[playerid][0]][Carid],0,0);
    Spectating[playerid][0]=-1;
    RemovePlayerFromVehicle(playerid);
    }
    return 1;
    }
    else
    {
    //Motorhaube zu
    new vid = GetPlayerVehicleID(playerid);
    new engine,lights1,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
    //Kofferraum zu
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
    //Licht aus
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);


    SendClientMessage(playerid, COLOR_GRAD1, "Du besitzt bereits ein Auto!");
    TogglePlayerControllable(playerid,1);
    SetVehicleParamsForAll(Kaufliste[Spectating[playerid][0]][Carid],0,0);
    Spectating[playerid][0]=-1;
    RemovePlayerFromVehicle(playerid);
    }
    }
    }
    }
    if(response == 0)
    {
    //Motorhaube zu
    new vid = GetPlayerVehicleID(playerid);
    new engine,lights1,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
    //Kofferraum zu
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
    //Licht aus
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
    SendClientMessage(playerid,COLOR_GRAD1,"Du hast den Fahrzeugkauf beendet.");
    TogglePlayerControllable(playerid,1);
    SetVehicleParamsForAll(Kaufliste[Spectating[playerid][0]][Carid],0,0);
    Spectating[playerid][0]=-1;
    RemovePlayerFromVehicle(playerid);
    return 1;
    }
    }
    return 1;
    }

  • public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid == DIALOG_AUTOKAUFEN)
    {
    if(response == 1)
    {
    new string[128];
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    if (Spectating[playerid][0]!=-1)
    {
    if (Carlist[playerid][s][Typ]==-1)
    {
    new preis = Kaufliste[Spectating[playerid][0]][Preis];
    if(Spectating[playerid][0] == -1)
    {
    //Motorhaube zu
    new vid = GetPlayerVehicleID(playerid);
    new engine,lights1,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
    //Kofferraum zu
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
    //Licht aus
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
    SendClientMessage(playerid, COLOR_GRAD1, "Du besichtigst kein Fahrzeug!");
    TogglePlayerControllable(playerid,1);
    SetVehicleParamsForAll(Kaufliste[Spectating[playerid][0]][Carid],0,0);
    Spectating[playerid][0]=-1;
    RemovePlayerFromVehicle(playerid);
    }
    else if (preis <= GetPlayerMoney(playerid))
    {
    new autohaus=Kaufliste[Spectating[playerid][0]][Autohaus];
    //Motorhaube zu
    new vid = GetPlayerVehicleID(playerid);
    new engine,lights1,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
    //Kofferraum zu
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
    //Licht aus
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);


    GivePlayerMoney(playerid, - preis);
    Carlist[playerid][s][Typ]=Spectating[playerid][0]; Carlist[playerid][s][X]=Autospawns[autohaus][X]; Carlist[playerid][s][Y]=Autospawns[autohaus][Y];
    Carlist[playerid][s][Z]=Autospawns[autohaus][Z]; Carlist[playerid][s][Rotation]=Autospawns[autohaus][Rotation]; Carlist[playerid][s][Status]=1; Carlist[playerid][s][Lock]=0;
    Carlist[playerid][s][Carid]=CreateVehicle(Kaufliste[Spectating[playerid][0]][Modelid],Carlist[playerid][s][X],Carlist[playerid][s][Y],Carlist[playerid][s][Z],Carlist[playerid][s][Rotation],-1,-1,-1);
    SetVehicleParamsForAll(Kaufliste[Spectating[playerid][0]][Carid],0,0);
    TogglePlayerControllable(playerid,1);
    Spectating[playerid][0]=-1;
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_WHITE, " ");
    format(string,128,"Du hast dir erfolgreich für $%i das Fahrzeug %s gekauft.",preis,Kaufliste[Carlist[playerid][s][Typ]][Name]);
    SendClientMessage(playerid, COLOR_GREEN, string);
    SendClientMessage(playerid, COLOR_YELLOW, "* Wenn dein Fahrzeug zerstört ist, gib /freparieren ein um es zu reparieren.");
    SendClientMessage(playerid, COLOR_YELLOW, "* Du kannst dein Fahrzeug mit /flock, auf- und abschließen.");
    SendClientMessage(playerid, COLOR_YELLOW, "* Mehr Befehle kannst du unter /fahrzeughelp sehen.");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_GREEN, "Dein Fahrzeug steht nun am Ausgabepunkt bereit! Viel Spaß mit dein neuen Fahrzeug");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_GREEN, "Fahr Vorsichtig!");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    }
    else
    {
    //Motorhaube zu
    new vid = GetPlayerVehicleID(playerid);
    new engine,lights1,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
    //Kofferraum zu
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
    //Licht aus
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);


    format(string, 128, "Du hast nicht keine $%i um das Fahrzeug zu kaufen.", preis); SendClientMessage(playerid, COLOR_GRAD1, string);
    TogglePlayerControllable(playerid,1);
    SetVehicleParamsForAll(Kaufliste[Spectating[playerid][0]][Carid],0,0);
    Spectating[playerid][0]=-1;
    RemovePlayerFromVehicle(playerid);
    }
    return 1;
    }
    }
    }
    //Motorhaube zu
    new vid = GetPlayerVehicleID(playerid);
    new engine,lights1,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
    //Kofferraum zu
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
    //Licht aus
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);


    SendClientMessage(playerid, COLOR_GRAD1, "Du besitzt bereits die maximale Anzahl an Fahrzeugen!");
    TogglePlayerControllable(playerid,1);
    SetVehicleParamsForAll(Kaufliste[Spectating[playerid][0]][Carid],0,0);
    Spectating[playerid][0]=-1;
    RemovePlayerFromVehicle(playerid);
    }
    if(response == 0)
    {
    //Motorhaube zu
    new vid = GetPlayerVehicleID(playerid);
    new engine,lights1,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
    //Kofferraum zu
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
    //Licht aus
    GetVehicleParamsEx(vid,engine,lights1,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
    SendClientMessage(playerid,COLOR_GRAD1,"Du hast den Fahrzeugkauf beendet.");
    TogglePlayerControllable(playerid,1);
    SetVehicleParamsForAll(Kaufliste[Spectating[playerid][0]][Carid],0,0);
    Spectating[playerid][0]=-1;
    RemovePlayerFromVehicle(playerid);
    return 1;
    }
    }
    return 1;
    }

  • Jeffry


    Danke nochmal das du mir Hilfst :) :)


    Ich kann jetzt jedoch die befehle nicht :/


    Spoiler anzeigen

    public OnPlayerCommandText(playerid, cmdtext[])
    {
    new cmd[128], idx, string[128];
    #if defined CARSELL
    new tmp[128];
    #endif
    cmd = strtok(cmdtext, idx);

    Spoiler anzeigen
    if(strcmp(cmd, "/fahrzeughelp", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    SendClientMessage(playerid, COLOR_WHITE, "{006600}====================== {FFFFFF}Fahrzeugbefehle {006600}======================");
    SendClientMessage(playerid, COLOR_WHITE,"* Fahrzeugbefehle: /parken /flock /freparieren /fverkaufen");
    #if defined CARSELL
    SendClientMessage(playerid, COLOR_WHITE,"* Fahrzeugbefehle: /sfverkaufen /cancelverkauf /acceptverkauf");
    #endif
    }
    return 1;
    }
    if(strcmp(cmd, "/carkey", true) == 0)
    {
    if(MaxVeh[playerid] > 1)
    {
    CarKey[playerid] += 1;
    if(CarKey[playerid] == MaxVeh[playerid])
    {
    CarKey[playerid] = 0;
    }
    if(Carlist[playerid][CarKey[playerid]][Typ] != -1)
    {
    new index = -1;
    for(new i=0; i<sizeof(Kaufliste); i++)
    {
    if(Kaufliste[i][Modelid] == Carlist[playerid][CarKey[playerid]][Typ])
    {
    index = i;
    break;
    }
    }
    if(index == -1) format(string, sizeof(string), "Du nimmst deinen %dten Auto-Schlüssel, für deinen <unbekannt> !", CarKey[playerid]+1);
    else format(string, sizeof(string), "Du nimmst deinen %dten Auto-Schlüssel, für deinen %s !", CarKey[playerid]+1, Kaufliste[index][Name]);
    }
    else
    {
    format(string, sizeof(string), "Du nimmst deinen %dten Auto-Schlüssel !",CarKey[playerid]+1);
    }
    SendClientMessage(playerid,COLOR_YELLOW,string);
    }
    return 1;
    }
    if(strcmp(cmd, "/parken", true) == 0)
    {
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    if (IsPlayerInVehicle(playerid,Carlist[playerid][s][Carid]))
    {
    GetVehiclePos(Carlist[playerid][s][Carid],Carlist[playerid][s][X],Carlist[playerid][s][Y],Carlist[playerid][s][Z]);
    GetVehicleZAngle(Carlist[playerid][s][Carid],Carlist[playerid][s][Rotation]);
    SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}» Dein Fahrzeug wurde nun an dieser Position {006600}erfolgreich{FFFFFF} geparkt.");
    }
    else { SendClientMessage(playerid, COLOR_GRAD1, "Du sitzt nicht in deinem eigenen Fahrzeug!"); }
    return 1;
    }
    return 1;
    }
    if(strcmp(cmd, "/freparieren", true) == 0)
    {
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    if (Carlist[playerid][s][Typ]!=-1)
    {
    if (Carlist[playerid][s][Status]==0)
    {
    new reparatur = Kaufliste[Carlist[playerid][s][Typ]][Reparatur];
    if (reparatur <= GetPlayerMoney(playerid))
    {
    Carlist[playerid][s][Status]=1;
    Carlist[playerid][s][Carid]=CreateTunedCar(playerid);
    GivePlayerMoney(playerid, - reparatur);
    format(string, 128, "{FFFFFF}» Dein Fahrzeug wurde für {FF0000}$%i{FFFFFF} repariert, das Fahrzeug steht nun an deinen Park-Punkt bereit.", reparatur);
    SendClientMessage(playerid, COLOR_RED, string);
    }
    else { format(string, 128, "Du hast nicht genug Geld für die Reparatur. Du benötigt $%i.", reparatur); SendClientMessage(playerid, COLOR_LIGHTRED, string); }
    }
    else { SendClientMessage(playerid, COLOR_GRAD1, "Dein Fahrzeug benötigt keine Reparatur!"); }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du besitzt kein Fahrzeug!");
    }
    return 1;
    }
    }
    if(strcmp(cmd, "/flock", true) == 0)
    {
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    if (Carlist[playerid][s][Typ]!=-1)
    {
    if (Carlist[playerid][s][Carid]!=-1)
    {
    if (Carlist[playerid][s][Lock]==0)
    {
    Carlist[playerid][s][Lock]=1;
    SetVehicleParamsForAll(Carlist[playerid][s][Carid],0,1);
    SetVehicleParamsForPlayer(Carlist[playerid][s][Carid],playerid,0,0);
    SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}» Du hast dein Fahrzeug {990000}abgeschlossen{FFFFFF}.");
    }
    else
    {
    Carlist[playerid][s][Lock]=0;
    SetVehicleParamsForAll(Carlist[playerid][s][Carid],0,0);
    SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}» Du hast dein Fahrzeug {006600}aufgeschlossen{FFFFFF}.");
    }
    }
    else { SendClientMessage(playerid, COLOR_GRAD1, "Du besitzt zur Zeit kein Fahrzeug!"); }
    }
    else { SendClientMessage(playerid, COLOR_GRAD1, "Du besitzt kein Fahrzeug!"); }
    return 1;
    }
    }
    if(strcmp(cmd, "/fverkaufen", true) == 0)
    {
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    if (Carlist[playerid][s][Typ]!=-1)
    {
    new preis = (Kaufliste[Carlist[playerid][s][Typ]][Preis]/5)*4;
    if (IsPlayerInVehicle(playerid,Carlist[playerid][s][Carid])) { RemovePlayerFromVehicle(playerid); }
    GivePlayerMoney(playerid, preis);
    DestroyVehicle(Carlist[playerid][s][Carid]);
    Carlist[playerid][s][Typ]=-1; Carlist[playerid][s][X]=0.0; Carlist[playerid][s][Y]=0.0; Carlist[playerid][s][Z]=0.0;
    Carlist[playerid][s][Rotation]=0.0; Carlist[playerid][s][Status]=0; Carlist[playerid][s][Lock]=0; Carlist[playerid][s][Carid]=-1;
    Carlist[playerid][s][Farbe1]=-1; Carlist[playerid][s][Farbe2]=-1; Carlist[playerid][s][mod1]=-1; Carlist[playerid][s][mod2]=-1;
    Carlist[playerid][s][mod3]=-1; Carlist[playerid][s][mod4]=-1; Carlist[playerid][s][mod5]=-1; Carlist[playerid][s][mod6]=-1;
    Carlist[playerid][s][mod7]=-1; Carlist[playerid][s][mod8]=-1; Carlist[playerid][s][mod9]=-1; Carlist[playerid][s][mod10]=-1;
    Carlist[playerid][s][mod11]=-1; Carlist[playerid][s][mod12]=-1; Carlist[playerid][s][mod13]=-1; Carlist[playerid][s][mod14]=-1;
    Carlist[playerid][s][mod15]=-1; Carlist[playerid][s][mod16]=-1; Carlist[playerid][s][mod17]=-1; Carlist[playerid][s][Paintjob]=-1;
    format(string,128,"{FFFFFF}» Du hast {006600}erfolgreich{FFFFFF} dein Fahrzeug für {FF0000}$%i{FFFFFF} verkauft!",preis);
    SendClientMessage(playerid, COLOR_WHITE, string);
    }
    else { SendClientMessage(playerid, COLOR_GRAD1, "Du besitzt kein Fahrzeug!"); }
    return 1;
    }
    }
    #if defined CARSELL
    if(strcmp(cmd, "/sfverkaufen", true) == 0)
    {
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    tmp = strtok(cmdtext, idx);
    if (!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Verwendung: /sfverkaufen [PlayerID] [Preis]");
    return 1;
    }
    new sellplayerid = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    if (!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Verwendung: /sfverkaufen [PlayerID] [Geld]");
    return 1;
    }
    new preis = strval(tmp);
    if (preis<0)
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Der Preis muss über $0 liegen.");
    return 1;
    }
    if (Carlist[playerid][s][Typ]==-1)
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du besitzt kein Auto!");
    return 1;
    }
    if (!IsPlayerConnected(sellplayerid))
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Dieser Spieler ist offline.");
    return 1;
    }
    bietetAn[sellplayerid][0]=playerid;
    bietetAn[sellplayerid][1]=preis;
    new playername[MAX_PLAYER_NAME];
    new sellplayername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    GetPlayerName(sellplayerid,sellplayername,sizeof(sellplayername));
    SendClientMessage(sellplayerid, COLOR_WHITE, " ");
    format(string,128,"* Du bietest den Fahrzeug, {FF0000}%s{FFFF00} für {FF0000}$%i{FFFF00} zum Verkauf an.",sellplayername,preis);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du kannst das Angebot mit /cancelverkauf zurückziehen.");
    SendClientMessage(sellplayerid, COLOR_WHITE, " ");
    format(string,128,"{FFFF00}* %s bietet dir das Fahrzeug {FF0000}%s{FFFF00} für {FF0000}$%i{FFFF00} zum Verkauf an.",playername,Kaufliste[Carlist[playerid][s][Typ]][Name],preis);
    SendClientMessage(sellplayerid, COLOR_YELLOW, string);
    SendClientMessage(sellplayerid, COLOR_LIGHTBLUE, "* Du kannst das Angebot mit /acceptverkauf annehmen.");
    SendClientMessage(sellplayerid, COLOR_WHITE, " ");
    return 1;
    }
    }
    #endif
    return 0;
    }

  • Du musst die Schleife
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    in den Befehlen jeweils mit dem Key ersetzen, dafür hast du die Keys ja gemacht. Du willst doch nicht alle Fahrzeuge auf einmal verkaufen, sondern nur eins, also das von dem du den Schlüssel hast.


    new s = CarKey[playerid];

  • Jeffry


    Wenn ich bei dem 2. Fahrzeug /parken machen will kommt eine Fehlermeldung. (Du sitzt nicht in deinem eigenen Fahrzeug!)



    if(strcmp(cmd, "/parken", true) == 0)
    {
    new s = CarKey[playerid];
    if (IsPlayerInVehicle(playerid,Carlist[playerid][s][Carid]))
    {
    GetVehiclePos(Carlist[playerid][s][Carid],Carlist[playerid][s][X],Carlist[playerid][s][Y],Carlist[playerid][s][Z]);
    GetVehicleZAngle(Carlist[playerid][s][Carid],Carlist[playerid][s][Rotation]);
    SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}» Dein Fahrzeug wurde nun an dieser Position {006600}erfolgreich{FFFFFF} geparkt.");
    }
    else { SendClientMessage(playerid, COLOR_GRAD1, "Du sitzt nicht in deinem eigenen Fahrzeug!"); }
    return 1;
    }

  • Jeffry


    so wird das geladen.



    public OnPlayerConnect(playerid)
    {
    new dateiname[MAX_PLAYER_NAME+25];
    new playername[MAX_PLAYER_NAME+25];
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    Carlist[playerid][s][Typ]=-1; Carlist[playerid][s][X]=0.0; Carlist[playerid][s][Y]=0.0; Carlist[playerid][s][Z]=0.0;
    Carlist[playerid][s][Rotation]=0.0; Carlist[playerid][s][Status]=0; Carlist[playerid][s][Lock]=0; Carlist[playerid][s][Carid]=-1;
    Carlist[playerid][s][Farbe1]=-1; Carlist[playerid][s][Farbe2]=-1; Carlist[playerid][s][mod1]=-1; Carlist[playerid][s][mod2]=-1;
    Carlist[playerid][s][mod3]=-1; Carlist[playerid][s][mod4]=-1; Carlist[playerid][s][mod5]=-1; Carlist[playerid][s][mod6]=-1;
    Carlist[playerid][s][mod7]=-1; Carlist[playerid][s][mod8]=-1; Carlist[playerid][s][mod9]=-1; Carlist[playerid][s][mod10]=-1;
    Carlist[playerid][s][mod11]=-1; Carlist[playerid][s][mod12]=-1; Carlist[playerid][s][mod13]=-1; Carlist[playerid][s][mod14]=-1;
    Carlist[playerid][s][mod15]=-1; Carlist[playerid][s][mod16]=-1; Carlist[playerid][s][mod17]=-1; Carlist[playerid][s][Paintjob]=-1;
    }
    Spectating[playerid][0]=-1;
    #if defined CARSELL
    bietetAn[playerid]={-1,0};
    #endif
    GetPlayerName(playerid, playername, sizeof(playername));
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    format(dateiname, sizeof(dateiname), "/GekaufteFahrzeuge/%s%d.car", playername,s);
    if (fexist(dateiname))
    {
    new File: CarFile = fopen(dateiname, io_read);
    if ( CarFile )
    {
    new key[ 256 ];
    new Data[ 256 ];
    while ( fread( CarFile , Data , sizeof( Data ) ) )
    {
    key = ini_GetKey(Data);
    if(strcmp(key,"AH_Typ",true)==0) { Carlist[playerid][s][Typ]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_X",true)==0) { Carlist[playerid][s][X]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Y",true)==0) { Carlist[playerid][s][Y]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Z",true)==0) { Carlist[playerid][s][Z]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Rot",true)==0) { Carlist[playerid][s][Rotation]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Status",true)==0) { Carlist[playerid][s][Status]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Lock",true)==0) { Carlist[playerid][s][Lock]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Paintjob",true)==0) { Carlist[playerid][s][Paintjob]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Farbe1",true)==0) { Carlist[playerid][s][Farbe1]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Farbe2",true)==0) { Carlist[playerid][s][Farbe2]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod1",true)==0) { Carlist[playerid][s][mod1]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod2",true)==0) { Carlist[playerid][s][mod2]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod3",true)==0) { Carlist[playerid][s][mod3]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod4",true)==0) { Carlist[playerid][s][mod4]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod5",true)==0) { Carlist[playerid][s][mod5]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod6",true)==0) { Carlist[playerid][s][mod6]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod7",true)==0) { Carlist[playerid][s][mod7]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod8",true)==0) { Carlist[playerid][s][mod8]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod9",true)==0) { Carlist[playerid][s][mod9]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod10",true)==0) { Carlist[playerid][s][mod10]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod11",true)==0) { Carlist[playerid][s][mod11]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod12",true)==0) { Carlist[playerid][s][mod12]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod13",true)==0) { Carlist[playerid][s][mod13]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod14",true)==0) { Carlist[playerid][s][mod14]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod15",true)==0) { Carlist[playerid][s][mod15]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod16",true)==0) { Carlist[playerid][s][mod16]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod17",true)==0) { Carlist[playerid][s][mod17]=strval(ini_GetValue(Data)); }
    }
    }
    fclose(CarFile);
    if(Carlist[playerid][s][Typ]!=-1 && Carlist[playerid][s][Status]==1)
    {
    Carlist[playerid][s][Carid]=CreateTunedCar(playerid);
    }
    }
    }
    SetTimerEx("DelaySetVehicleParams",10000,0,"i",playerid);
    return 1;
    }

  • Das sieht soweit gut aus.
    Debugge den Befehl mal so, und poste dann was im Server Log steht, wenn du den Befehl eingibst:
    if(strcmp(cmd, "/parken", true) == 0)
    {
    new s = CarKey[playerid];
    printf("s: %d", s);
    printf("carid: %d | inVeh: %d", Carlist[playerid][s][Carid], GetPlayerVehicleID(playerid));
    if (IsPlayerInVehicle(playerid,Carlist[playerid][s][Carid]))
    {
    GetVehiclePos(Carlist[playerid][s][Carid],Carlist[playerid][s][X],Carlist[playerid][s][Y],Carlist[playerid][s][Z]);
    GetVehicleZAngle(Carlist[playerid][s][Carid],Carlist[playerid][s][Rotation]);
    SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}» Dein Fahrzeug wurde nun an dieser Position {006600}erfolgreich{FFFFFF} geparkt.");
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du sitzt nicht in deinem eigenen Fahrzeug!");
    }
    return 1;
    }

  • Jeffry


    So, ich habe vergessen, den Schlüssel zu wechseln.
    Ich habe jetzt, jedoch das Problem wenn /parken mache dann werden auch die Fahrzeuge geparkt, jedoch, wenn ich wieder ingame gehe steht das Fahrzeug im Slot2 auf der Position von Slot1. Das Fahrzeug ist zudem das selbe wie in Slot1.
    Log:



    [16:29:41] s: 0
    [16:29:41] carid: 933 | inVeh: 933
    [16:30:27] s: 1
    [16:30:27] carid: 934 | inVeh: 934

  • Jeffry



    public OnPlayerDisconnect(playerid)
    {
    new dateiname[MAX_PLAYER_NAME+25];
    new playername[MAX_PLAYER_NAME+25];
    new var[256];
    GetPlayerName(playerid, playername, sizeof(playername));
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    format(dateiname, sizeof(dateiname), "/GekaufteFahrzeuge/%s%d.car", playername,s);
    new File: CarFile = fopen(dateiname, io_write);
    format(var, 256, "AH_Typ=%i\n", Carlist[playerid][s][Typ]); fwrite(CarFile, var);
    format(var, 256, "AH_X=%f\n", Carlist[playerid][s][X]); fwrite(CarFile, var);
    format(var, 256, "AH_Y=%f\n", Carlist[playerid][s][Y]); fwrite(CarFile, var);
    format(var, 256, "AH_Z=%f\n", Carlist[playerid][s][Z]); fwrite(CarFile, var);
    format(var, 256, "AH_Rot=%f\n", Carlist[playerid][s][Rotation]); fwrite(CarFile, var);
    format(var, 256, "AH_Status=%i\n", Carlist[playerid][s][Status]); fwrite(CarFile, var);
    format(var, 256, "AH_Lock=%i\n", Carlist[playerid][s][Lock]); fwrite(CarFile, var);
    format(var, 256, "AH_Paintjob=%i\n", Carlist[playerid][s][Paintjob]); fwrite(CarFile, var);
    format(var, 256, "AH_Farbe1=%i\n", Carlist[playerid][s][Farbe1]); fwrite(CarFile, var);
    format(var, 256, "AH_Farbe2=%i\n", Carlist[playerid][s][Farbe2]); fwrite(CarFile, var);
    format(var, 256, "AH_mod1=%i\n", Carlist[playerid][s][mod1]); fwrite(CarFile, var);
    format(var, 256, "AH_mod2=%i\n", Carlist[playerid][s][mod2]); fwrite(CarFile, var);
    format(var, 256, "AH_mod3=%i\n", Carlist[playerid][s][mod3]); fwrite(CarFile, var);
    format(var, 256, "AH_mod4=%i\n", Carlist[playerid][s][mod4]); fwrite(CarFile, var);
    format(var, 256, "AH_mod5=%i\n", Carlist[playerid][s][mod5]); fwrite(CarFile, var);
    format(var, 256, "AH_mod6=%i\n", Carlist[playerid][s][mod6]); fwrite(CarFile, var);
    format(var, 256, "AH_mod7=%i\n", Carlist[playerid][s][mod7]); fwrite(CarFile, var);
    format(var, 256, "AH_mod8=%i\n", Carlist[playerid][s][mod8]); fwrite(CarFile, var);
    format(var, 256, "AH_mod9=%i\n", Carlist[playerid][s][mod9]); fwrite(CarFile, var);
    format(var, 256, "AH_mod10=%i\n", Carlist[playerid][s][mod10]); fwrite(CarFile, var);
    format(var, 256, "AH_mod11=%i\n", Carlist[playerid][s][mod11]); fwrite(CarFile, var);
    format(var, 256, "AH_mod12=%i\n", Carlist[playerid][s][mod12]); fwrite(CarFile, var);
    format(var, 256, "AH_mod13=%i\n", Carlist[playerid][s][mod13]); fwrite(CarFile, var);
    format(var, 256, "AH_mod14=%i\n", Carlist[playerid][s][mod14]); fwrite(CarFile, var);
    format(var, 256, "AH_mod15=%i\n", Carlist[playerid][s][mod15]); fwrite(CarFile, var);
    format(var, 256, "AH_mod16=%i\n", Carlist[playerid][s][mod16]); fwrite(CarFile, var);
    format(var, 256, "AH_mod17=%i\n", Carlist[playerid][s][mod17]); fwrite(CarFile, var);
    fclose(CarFile);
    if(Carlist[playerid][s][Carid]!=-1)
    {
    SetVehicleParamsForAll(Carlist[playerid][s][Carid],0,0);
    DestroyVehicle(Carlist[playerid][s][Carid]);
    Carlist[playerid][s][Carid]=-1;
    }
    if (Spectating[playerid][0]!=-1)
    {
    SetVehicleParamsForAll(Kaufliste[Spectating[playerid][0]][Carid],0,0);
    Spectating[playerid][0]=-1;
    }
    }
    return 1;
    }

  • Jeffry


    Es wird bei mir über OnPlayerConnect geladen... :/


    public OnPlayerConnect(playerid)
    {
    new dateiname[MAX_PLAYER_NAME+25];
    new playername[MAX_PLAYER_NAME+25];
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    Carlist[playerid][s][Typ]=-1; Carlist[playerid][s][X]=0.0; Carlist[playerid][s][Y]=0.0; Carlist[playerid][s][Z]=0.0;
    Carlist[playerid][s][Rotation]=0.0; Carlist[playerid][s][Status]=0; Carlist[playerid][s][Lock]=0; Carlist[playerid][s][Carid]=-1;
    Carlist[playerid][s][Farbe1]=-1; Carlist[playerid][s][Farbe2]=-1; Carlist[playerid][s][mod1]=-1; Carlist[playerid][s][mod2]=-1;
    Carlist[playerid][s][mod3]=-1; Carlist[playerid][s][mod4]=-1; Carlist[playerid][s][mod5]=-1; Carlist[playerid][s][mod6]=-1;
    Carlist[playerid][s][mod7]=-1; Carlist[playerid][s][mod8]=-1; Carlist[playerid][s][mod9]=-1; Carlist[playerid][s][mod10]=-1;
    Carlist[playerid][s][mod11]=-1; Carlist[playerid][s][mod12]=-1; Carlist[playerid][s][mod13]=-1; Carlist[playerid][s][mod14]=-1;
    Carlist[playerid][s][mod15]=-1; Carlist[playerid][s][mod16]=-1; Carlist[playerid][s][mod17]=-1; Carlist[playerid][s][Paintjob]=-1;
    }
    Spectating[playerid][0]=-1;
    #if defined CARSELL
    bietetAn[playerid]={-1,0};
    #endif
    GetPlayerName(playerid, playername, sizeof(playername));
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    format(dateiname, sizeof(dateiname), "/GekaufteFahrzeuge/%s%d.car", playername,s);
    if (fexist(dateiname))
    {
    new File: CarFile = fopen(dateiname, io_read);
    if ( CarFile )
    {
    new key[ 256 ];
    new Data[ 256 ];
    while ( fread( CarFile , Data , sizeof( Data ) ) )
    {
    key = ini_GetKey(Data);
    if(strcmp(key,"AH_Typ",true)==0) { Carlist[playerid][s][Typ]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_X",true)==0) { Carlist[playerid][s][X]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Y",true)==0) { Carlist[playerid][s][Y]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Z",true)==0) { Carlist[playerid][s][Z]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Rot",true)==0) { Carlist[playerid][s][Rotation]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Status",true)==0) { Carlist[playerid][s][Status]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Lock",true)==0) { Carlist[playerid][s][Lock]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Paintjob",true)==0) { Carlist[playerid][s][Paintjob]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Farbe1",true)==0) { Carlist[playerid][s][Farbe1]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Farbe2",true)==0) { Carlist[playerid][s][Farbe2]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod1",true)==0) { Carlist[playerid][s][mod1]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod2",true)==0) { Carlist[playerid][s][mod2]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod3",true)==0) { Carlist[playerid][s][mod3]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod4",true)==0) { Carlist[playerid][s][mod4]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod5",true)==0) { Carlist[playerid][s][mod5]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod6",true)==0) { Carlist[playerid][s][mod6]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod7",true)==0) { Carlist[playerid][s][mod7]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod8",true)==0) { Carlist[playerid][s][mod8]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod9",true)==0) { Carlist[playerid][s][mod9]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod10",true)==0) { Carlist[playerid][s][mod10]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod11",true)==0) { Carlist[playerid][s][mod11]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod12",true)==0) { Carlist[playerid][s][mod12]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod13",true)==0) { Carlist[playerid][s][mod13]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod14",true)==0) { Carlist[playerid][s][mod14]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod15",true)==0) { Carlist[playerid][s][mod15]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod16",true)==0) { Carlist[playerid][s][mod16]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod17",true)==0) { Carlist[playerid][s][mod17]=strval(ini_GetValue(Data)); }
    }
    }
    fclose(CarFile);
    if(Carlist[playerid][s][Typ]!=-1 && Carlist[playerid][s][Status]==1)
    {
    Carlist[playerid][s][Carid]=CreateTunedCar(playerid);
    }
    }
    }
    SetTimerEx("DelaySetVehicleParams",10000,0,"i",playerid);
    return 1;
    }

  • Jeffry



    public CreateTunedCar(playerid)
    {
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    if(IsPlayerConnected(playerid) && Carlist[playerid][s][Typ]!=-1)
    {
    new carid=CreateVehicle(Kaufliste[Carlist[playerid][s][Typ]][Modelid],Carlist[playerid][s][X],Carlist[playerid][s][Y],Carlist[playerid][s][Z],Carlist[playerid][s][Rotation],-1,-1,-1);
    if(Carlist[playerid][s][Lock]==1)
    {
    SetVehicleParamsForAll(carid,0,1);
    SetVehicleParamsForPlayer(carid,playerid,0,0);
    }
    if(Carlist[playerid][s][mod1]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod1]); }
    if(Carlist[playerid][s][mod2]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod2]); }
    if(Carlist[playerid][s][mod3]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod3]); }
    if(Carlist[playerid][s][mod4]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod4]); }
    if(Carlist[playerid][s][mod5]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod5]); }
    if(Carlist[playerid][s][mod6]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod6]); }
    if(Carlist[playerid][s][mod7]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod7]); }
    if(Carlist[playerid][s][mod8]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod8]); }
    if(Carlist[playerid][s][mod9]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod9]); }
    if(Carlist[playerid][s][mod10]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod10]); }
    if(Carlist[playerid][s][mod11]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod11]); }
    if(Carlist[playerid][s][mod12]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod12]); }
    if(Carlist[playerid][s][mod13]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod13]); }
    if(Carlist[playerid][s][mod14]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod14]); }
    if(Carlist[playerid][s][mod15]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod15]); }
    if(Carlist[playerid][s][mod16]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod16]); }
    if(Carlist[playerid][s][mod17]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod17]); }
    if(Carlist[playerid][s][Paintjob]!=-1) { ChangeVehiclePaintjob(carid,Carlist[playerid][s][Paintjob]); }
    if(Carlist[playerid][s][Farbe1]!=-1) { ChangeVehicleColor(carid,Carlist[playerid][s][Farbe1],Carlist[playerid][s][Farbe2]); }
    return carid;
    }
    }
    return 1;
    }

  • public CreateTunedCar(playerid, s)
    {
    if(IsPlayerConnected(playerid) && Carlist[playerid][s][Typ]!=-1)
    {
    new carid=CreateVehicle(Kaufliste[Carlist[playerid][s][Typ]][Modelid],Carlist[playerid][s][X],Carlist[playerid][s][Y],Carlist[playerid][s][Z],Carlist[playerid][s][Rotation],-1,-1,-1);
    if(Carlist[playerid][s][Lock]==1)
    {
    SetVehicleParamsForAll(carid,0,1);
    SetVehicleParamsForPlayer(carid,playerid,0,0);
    }
    if(Carlist[playerid][s][mod1]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod1]); }
    if(Carlist[playerid][s][mod2]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod2]); }
    if(Carlist[playerid][s][mod3]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod3]); }
    if(Carlist[playerid][s][mod4]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod4]); }
    if(Carlist[playerid][s][mod5]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod5]); }
    if(Carlist[playerid][s][mod6]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod6]); }
    if(Carlist[playerid][s][mod7]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod7]); }
    if(Carlist[playerid][s][mod8]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod8]); }
    if(Carlist[playerid][s][mod9]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod9]); }
    if(Carlist[playerid][s][mod10]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod10]); }
    if(Carlist[playerid][s][mod11]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod11]); }
    if(Carlist[playerid][s][mod12]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod12]); }
    if(Carlist[playerid][s][mod13]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod13]); }
    if(Carlist[playerid][s][mod14]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod14]); }
    if(Carlist[playerid][s][mod15]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod15]); }
    if(Carlist[playerid][s][mod16]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod16]); }
    if(Carlist[playerid][s][mod17]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod17]); }
    if(Carlist[playerid][s][Paintjob]!=-1) { ChangeVehiclePaintjob(carid,Carlist[playerid][s][Paintjob]); }
    if(Carlist[playerid][s][Farbe1]!=-1) { ChangeVehicleColor(carid,Carlist[playerid][s][Farbe1],Carlist[playerid][s][Farbe2]); }
    return carid;
    }
    return 1;
    }


    und
    Carlist[playerid][s][Carid]=CreateTunedCar(playerid);
    zu:
    Carlist[playerid][s][Carid]=CreateTunedCar(playerid,s);

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