hauto haus system bug

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
  • der dialog beim einsteigen des autos öffnet sich nicht warum?
    man wird gefreezt das wars aber auch schon



    oben

    enum ahSpawn
    {
    Float:CarPos_x,
    Float:CarPos_y,
    Float:CarPos_z,
    Float:CarRotate,
    };
    new Autospawns[1][ahSpawn] = {
    {991.7200,-1335.4635,13.3828,272.5566}
    };

    enum aHaus
    {
    Name[128],
    Autohaus,
    Modelid,
    Carid,
    aPreis,
    Float:CarPos_x,
    Float:CarPos_y,
    Float:CarPos_z,
    Float:CarRotate,
    Tank,
    };
    new Kaufliste[12][aHaus] = {



    // Intercars - Fahrzeugname, 0, Fahrzeug ID, FAhrzeug Preis, x,y,z,r,Tank
    {"Solair", 0, 458, 1, 15000, 1014.4832,-1345.1400,13.2701,86.6874, 70},
    // {"Strech", 0, 409, 1, 1250000, 1372.2598,-1780.4355,14.2560,50.7219, 125},
    {"Sunrise", 0, 550, 1, 17000, 1014.8960,-1350.1807,13.1689,90.3120, 60},
    {"Sentinel", 0, 405, 1, 20000, 1014.8726,-1360.5687,13.2820,91.4990, 50},
    {"Landstalker", 0, 400, 1, 18000, 1014.6984,-1365.0400,13.4427,90.6577, 60},
    {"Elegant", 0, 507, 1, 20000, 991.7257,-1368.3928,13.2183,270.5254, 70},
    {"Nebula", 0, 516, 1, 150000, 991.7772,-1364.6997,13.2218,268.3752, 35},
    {"Willard", 0, 529, 1, 5000, 992.3073,-1360.6838,12.9411,270.3429, 35},
    {"Primo", 0, 547, 1, 10000, 991.8157,-1357.0276,13.1080,274.5017, 120},
    {"Club", 0, 589, 1, 5000, 991.8795,-1353.4607,13.0076,269.6971, 120},
    {"Emperor", 0, 585, 1, 13000, 992.3187,-1349.8716,12.9632,268.9381, 80},
    {"Moonbeam", 0, 418, 1, 7000, 992.2755,-1346.4882,13.4447,269.9544, 80},
    {"pony", 0, 413, 1, 25000, 992.6348,-1342.4216,13.4461,271.9776, 20}
    };



    wenn er im fahzeug ist



    if(newstate == PLAYER_STATE_DRIVER) //buggy dont finnish
    {// 38 / 49 / 56 = SS
    new vehicleid = GetPlayerVehicleID(playerid);
    new typ, string1[128];
    typ=IsAutohausCar(vehicleid);
    if(typ!=-1)
    {
    FreezePlayer(playerid);
    Spectating[playerid][0]=typ;
    format(string1, sizeof(string1), "{336666}Fahrzeug:{FFFFFF}\t %s\n{336666}Preis:{FFFFFF}\t\t $%d\n{336666}Tank:{FFFFFF}\t\t %dLiter", Kaufliste[typ][Name], Kaufliste[typ][aPreis], Kaufliste[typ][Tank]);
    ShowPlayerDialog(playerid, DIALOG_SELLCAR, DIALOG_STYLE_MSGBOX, "{FF9933}Autohaus", string, "Kaufen", "Abbrechen");
    }
    for(new i=0; i<MAX_CARS; i++)
    {
    if(GetPlayerVehicleID(playerid)==Frakcar[i])
    {
    if(PlayerInfo[playerid][pMember] != FCInfo[i][Frakid] && PlayerInfo[playerid][pLeader] != FCInfo[i][Frakid]) // && PlayerInfo[playerid][pAdmin] < ADMLVL)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,COLOR_LIGHTRED,"Du darfst dieses Fahrzeug nicht fahren.");
    }
    }
    }
    new newcar = GetPlayerVehicleID(playerid);
    new oldcar = gLastCar[playerid];
    new housecar = PlayerInfo[playerid][pPhousekey]+1;
    TelePos[playerid][0] = 0.0;
    TelePos[playerid][1] = 0.0;
    if(IsAPlane(newcar))
    {
    if(PlayerInfo[playerid][pFlyLic] < 1)
    {
    if(TakingLesson[playerid] == 1) { }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Du hast keinen Flugschein !");
    RemovePlayerFromVehicle(playerid);
    }
    }
    }
    else if(IsABike(newcar))
    {
    if(PlayerInfo[playerid][pMotoLic] < 1)
    {
    if(TakingLesson[playerid] == 1) { }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Du hast kein Motorrad Schein !");
    RemovePlayerFromVehicle(playerid);
    }
    }
    }
    else if(IsALKW(newcar))
    {
    if(PlayerInfo[playerid][pLKWLic] == 0)
    {
    if(TakingLesson[playerid] == 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " Du hast kein LKW Schein !");
    RemovePlayerFromVehicle(playerid);
    }
    }
    }
    else if(IsANoLicVehicle(newcar)) { }
    else
    {
    if(PlayerInfo[playerid][pCarLic] < 1)
    {
    if(PlayerDrunk[playerid] >= 5)
    {
    WantedPoints[playerid] += 1;
    SetPlayerCriminal(playerid,255, "Betrunken am Steuer...");
    SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+1);
    }
    if((TakingLesson[playerid] == 1) || IsPlayerNPC(playerid))
    {
    }
    else {
    SendClientMessage(playerid, COLOR_GREY, " Du hast noch keinen Führerschein !");
    RemovePlayerFromVehicle(playerid);
    return 1; }
    }
    else if(PlayerDrunk[playerid] >= 5)
    {
    WantedPoints[playerid] += 1;
    SetPlayerCriminal(playerid,255, "Betrunken am Steuer...");
    SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+1);
    }
    else if(PlayerDrunk[playerid] >= 5)
    {
    WantedPoints[playerid] += 1;
    SetPlayerCriminal(playerid,255, "Betrunken am Steuer...");
    SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+1);
    }
    }//Done with car check



    if(GetVehicleModel(newcar) == 408)
    {
    if(PlayerInfo[playerid][pJob] == 17)
    {
    if(Mullabfuhr[playerid] == 0)
    {
    SendClientMessage(playerid,COLOR_YELLOW," Um deinen Dienst als Müllmann zu starten, benutze /starten");
    }
    }
    else
    {
    SendClientMessage(playerid,COLOR_WHITE," Dieser Wagen ist nur für Müllmänner da!");
    RemovePlayerFromVehicle(playerid);
    }
    }



    for(new v=0; v<sizeof(HafenKlause); v++)
    {
    if(newcar == HafenKlause[v])
    {
    new cost = SBizzInfo[1][sbEntranceCost];
    if(GetPlayerMoney(playerid) >= cost)
    {
    GivePlayerMoney(playerid,-cost);
    SBizzInfo[1][sbTill] += cost;
    format(string,sizeof(string),"Bootsfahrt:Du zahlst $%d",cost);
    SendClientMessage(playerid,COLOR_WHITE,string);
    //GameTextForPlayer(playerid,string,5000,3);
    }
    else
    {
    format(string,sizeof(string)," Die Bootsfahrt kostet $%d. Du hast nicht soviel!",cost);
    SendClientMessage(playerid,COLOR_WHITE,string);
    RemovePlayerFromVehicle(playerid);
    }
    return 1;
    }
    }
    if(PlayerInfo[playerid][pAdmin] > 0) { return 1; }



    if(newcar == HitmanLeaderBullet && PlayerInfo[playerid][pLeader] != 8)
    {
    SendClientMessage(playerid,COLOR_WHITE," Dieser Wagen ist Eigentum der Hitmen!");
    RemovePlayerFromVehicle(playerid);
    }
    if(GetVehicleModel(newcar) == 525 && !IsPlayerInFrac(playerid,24))
    {
    SendClientMessage(playerid,COLOR_WHITE," Dieser Wagen ist Eigentum der Abschleppfirma!");
    RemovePlayerFromVehicle(playerid);
    }
    if(PlayerKarting[playerid] != 0)
    {
    new kart = GetPlayerVehicleID(playerid);
    if(kart==110||kart==111||kart==112||kart==113||kart==114||kart==115)
    {
    PlayerInKart[playerid] = 1;
    KartingPlayers ++;
    }
    }
    if(GetVehicleModel(newcar) == 582 || GetVehicleModel(newcar) == 488)
    {
    if(!IsPlayerInFrac(playerid,9))
    {
    SendClientMessage(playerid,COLOR_GREY," Dieses Fahrzeug darfst du nur als News Reporter benutzen!");
    RemovePlayerFromVehicle(playerid);
    return 1;
    }
    }
    if(IsABus(newcar) && newcar != RMBus)
    {
    if(PlayerInfo[playerid][pJob] != 14)
    {
    SendClientMessage(playerid,COLOR_GREY," Du bist kein Busfahrer !");
    RemovePlayerFromVehicle(playerid);
    return 1;
    }
    }
    if(IsATaxi(newcar))
    {
    if(!IsPlayerInFrac(playerid,10))
    {
    SendClientMessage(playerid,COLOR_GREY," Dieses Fahrzeug darfst du nur als Taxifahrer benutzen!");
    RemovePlayerFromVehicle(playerid);
    return 1;
    }
    }
    if(IsACopCar(newcar))
    {
    if(IsACop(playerid) || IsPlayerInFrac(playerid,23)) { }
    else { RemovePlayerFromVehicle(playerid); return 1;}
    }
    if(IsATruck(GetPlayerVehicleID(playerid)))
    {
    format(string, sizeof(string), "Products: %d/%d", PlayerHaul[newcar][pLoad],PlayerHaul[newcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    SendClientMessage(playerid, COLOR_WHITE, "INFO: Du kannst mit diesem Fahrzeug Produkte ausliefern.");
    SendClientMessage(playerid, COLOR_WHITE, "INFO: Die Befehle lauten: /load /buyprods /sellprods");
    }
    if(oldcar != 301)
    {
    if((housecar != oldcar && oldcar != 0) && (HireCar[playerid] != oldcar && newcar != housecar))
    {
    if(gLastDriver[oldcar] == playerid && oldcar != newcar)
    {
    gLastDriver[oldcar] = 300;
    gCarLock[oldcar] = 0;
    UnLockCar(oldcar);
    }
    }
    }



    gLastCar[playerid] = newcar;
    gLastDriver[newcar] = playerid;
    }




    der Dialog




    if(dialogid==DIALOG_SELLCAR)
    {
    if(response)
    {
    print("D1");
    if(Spectating[playerid][0]!=-1)
    {
    print("D2");
    if(!PlayerHaveCar[playerid][PlayerKey[playerid]])
    {
    print("D3");
    new preis = Kaufliste[Spectating[playerid][0]][aPreis];
    print("D4");
    if(GetPlayerMoney(playerid) > preis)
    {
    // new name[MAX_PLAYER_NAME];
    print("D5");
    new autohaus=Kaufliste[Spectating[playerid][0]][Autohaus];
    GivePlayerMoney(playerid, -preis);
    print("D6");
    new prname[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, prname, sizeof prname);
    format(str, sizeof str, "/Autos/%s_Car_%d.ini", prname,PlayerKey[playerid]);
    new File: hFile = fopen(str, io_write);
    if (hFile)
    {
    new var[32];
    format(var, 32, "CarId=%d\n", PlayerCar[playerid][PlayerKey[playerid]][CarId]=Spectating[playerid][0]);fwrite(hFile, var);
    format(var, 32, "CarModel=%d\n",PlayerCar[playerid][PlayerKey[playerid]][CarModel]=Kaufliste[Spectating[playerid][0]][Modelid]);fwrite(hFile, var);
    format(var, 32, "CarPos_x=%.3f\n",PlayerCar[playerid][PlayerKey[playerid]][CarPos_x]=Autospawns[autohaus][CarPos_x]);fwrite(hFile, var);
    format(var, 32, "CarPos_y=%.3f\n",PlayerCar[playerid][PlayerKey[playerid]][CarPos_y]=Autospawns[autohaus][CarPos_y]);fwrite(hFile, var);
    format(var, 32, "CarPos_z=%.3f\n",PlayerCar[playerid][PlayerKey[playerid]][CarPos_z]=Autospawns[autohaus][CarPos_z]);fwrite(hFile, var);
    format(var, 32, "CarRotate=%.3f\n",PlayerCar[playerid][PlayerKey[playerid]][CarRotate]=Autospawns[autohaus][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",PlayerCar[playerid][PlayerKey[playerid]][CarPreis]=preis/2);fwrite(hFile, var);
    format(var, 32, "Tank=%d\n", Kaufliste[Spectating[playerid][0]][Tank]); fwrite(hFile, var);
    format(var, 32, "MaxTank=%d\n", Kaufliste[Spectating[playerid][0]][Tank]); fwrite(hFile, var);
    format(var, 32, "CarState=%d\n", PlayerCar[playerid][PlayerKey[playerid]][CarState]);fwrite(hFile, var);
    fclose(hFile);
    }



    PlayerCar[playerid][PlayerKey[playerid]][CarId]=Spectating[playerid][0];
    PlayerCar[playerid][PlayerKey[playerid]][CarModel]=Kaufliste[Spectating[playerid][0]][Modelid];
    PlayerCar[playerid][PlayerKey[playerid]][CarPos_x]=Autospawns[autohaus][CarPos_x];
    PlayerCar[playerid][PlayerKey[playerid]][CarPos_y]=Autospawns[autohaus][CarPos_y];
    PlayerCar[playerid][PlayerKey[playerid]][CarPos_z]=Autospawns[autohaus][CarPos_z];
    PlayerCar[playerid][PlayerKey[playerid]][CarRotate]=Autospawns[autohaus][CarRotate];
    PlayerCar[playerid][PlayerKey[playerid]][CarNitro]=0;
    PlayerCar[playerid][PlayerKey[playerid]][CarHyd]=0;
    print("D7");
    PlayerCar[playerid][PlayerKey[playerid]][CarWheel]=0;
    PlayerCar[playerid][PlayerKey[playerid]][CarAusp]=0;
    PlayerCar[playerid][PlayerKey[playerid]][CarSideL]=0;
    PlayerCar[playerid][PlayerKey[playerid]][CarSideR]=0;
    PlayerCar[playerid][PlayerKey[playerid]][CarFB]=0;
    PlayerCar[playerid][PlayerKey[playerid]][CarRB]=0;
    PlayerCar[playerid][PlayerKey[playerid]][CarSpoiler]=0;
    PlayerCar[playerid][PlayerKey[playerid]][CarRoof]=0;
    PlayerCar[playerid][PlayerKey[playerid]][CarHood]=0;
    PlayerCar[playerid][PlayerKey[playerid]][CarVents]=0;
    PlayerCar[playerid][PlayerKey[playerid]][CarLamps]=0;
    PlayerCar[playerid][PlayerKey[playerid]][CarPJ]=-1;
    PlayerCar[playerid][PlayerKey[playerid]][CarC1]=1;
    PlayerCar[playerid][PlayerKey[playerid]][CarC2]=1;
    print("D8");
    PlayerCar[playerid][PlayerKey[playerid]][CarPreis]=preis/2;
    PlayerCar[playerid][PlayerKey[playerid]][CarTank]=Kaufliste[Spectating[playerid][0]][Tank];
    PlayerCar[playerid][PlayerKey[playerid]][CarMaxTank]=Kaufliste[Spectating[playerid][0]][Tank];
    PlayerCar[playerid][PlayerKey[playerid]][CarState]=0;
    print("D9");
    PlayerCar[playerid][PlayerKey[playerid]][CarId] = CreateVehicle(PlayerCar[playerid][PlayerKey[playerid]][CarModel],PlayerCar[playerid][PlayerKey[playerid]][CarPos_x],PlayerCar[playerid][PlayerKey[playerid]][CarPos_y],PlayerCar[playerid][PlayerKey[playerid]][CarPos_z],PlayerCar[playerid][PlayerKey[playerid]][CarRotate],PlayerCar[playerid][PlayerKey[playerid]][CarC1],PlayerCar[playerid][PlayerKey[playerid]][CarC2], -1);/*vehicle spawn*/
    Gas[PlayerCar[playerid][PlayerKey[playerid]][CarId]] = Kaufliste[Spectating[playerid][0]][Tank];
    gGas[PlayerCar[playerid][PlayerKey[playerid]][CarId]] = Kaufliste[Spectating[playerid][0]][Tank];
    SetVehicleParamsEx(PlayerCar[playerid][PlayerKey[playerid]][CarId], false, false, false, true, false, false, false);
    SetVehicleNumberPlate(PlayerCar[playerid][PlayerKey[playerid]][CarId], SpielerName(playerid));
    RemovePlayerFromVehicle(playerid);
    print("D10");
    FreezePlayer(playerid);
    print("D11");
    UnfreezePlayer(playerid);
    print("D12");
    new Float:x, Float: y, Float:z;
    GetVehiclePos(PlayerCar[playerid][PlayerKey[playerid]][CarId], x, y, z);
    SetPlayerCheckpoint(playerid, x,y,z, 5.0);
    PlayerHaveCar[playerid][PlayerKey[playerid]] = 1;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Das Fahrzeug steht am Ausgabe Punkt bereit.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Mit /carhelp siehst du die Fahrzeug Befehle.");
    }
    else
    {
    SendClientMessage(playerid, ROT, "Du hast nicht genügend Geld dabei!");
    FreezePlayer(playerid);
    RemovePlayerFromVehicle(playerid);
    UnfreezePlayer(playerid);
    return 1;
    }
    }
    else
    {
    FreezePlayer(playerid);
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, BLAU, "Auf diesem Schlüssel ist bereits ein Fahrzeug!");
    UnfreezePlayer(playerid);
    return 1;
    }
    }
    }
    if(!response)
    {
    FreezePlayer(playerid);
    RemovePlayerFromVehicle(playerid);
    UnfreezePlayer(playerid);
    return 1;
    }
    }





    bitte um hilfe


    mfg
    LordHit




    bitte um hilfe