SAMP Scipt fehler

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Ich hab ein Problem Ich hab so ein Autohaus erstellt


    ----> http://www.pic-upload.de/view-15878360/sa-mp-001.png.html



    und das Problem ist das auto Spawnt am ein Bauernhof


    ----> http://www.pic-upload.de/view-15878435/sa-mp-002.png.html



    kann mir einer sagen warum



    meine emun





    • enum ahSpawn
      {
      Float:CarPos_x,
      Float:CarPos_y,
      Float:CarPos_z,
      Float:CarRotate,
      };


      enum aHaus
      {
      Name[128],
      Autohaus,//0=Intercars,1=Grottis
      Modelid,
      Carid,
      aPreis,
      Float:CarPos_x,
      Float:CarPos_y,
      Float:CarPos_z,
      Float:CarRotate,
      Tank,
      };


      new Kaufliste[22][aHaus] =
      {
      // Intercars //
      {"Virgo", 0, 491, 1, 7500, 738.2218,-1333.2441,13.3006,179.4652, 60},//intercars
      {"Comet", 0, 480, 1, 12000, 742.6456,-1333.6265,13.3105,177.3891, 60},//intercars
      {"Premier", 0, 426, 1, 12500, 747.2948,-1333.5927,13.2865,179.4888, 60},//intercars
      {"Phoenix", 0, 603, 1, 26000, 752.3946,-1333.4897,13.3817,179.2118, 60},//intercars
      {"Slamvan", 0, 535, 1, 18000, 757.2639,-1333.8567,13.3063,178.5301, 60},//intercars
      {"Broadway", 0, 575, 1, 16000, 761.9200,-1333.8467,13.1466,179.4905, 60},//intercars
      {"Elegy", 0, 562, 1, 26000, 766.5497,-1333.7371,13.2016,180.3142, 60},//intercars
      {"Voodoo", 0, 412, 1, 6000, 782.4635,-1338.8204,13.3763,90.6943, 60},//intercars
      {"Tampa", 0, 549, 1, 2500, 782.3835,-1343.0145,13.1885,90.6917, 60},//intercars
      {"Oceanic", 0, 467, 1, 12000, 782.9632,-1346.9535,13.2502,90.2770, 60},//intercars
      {"Tarnado", 0, 576, 1, 10000, 782.7252,-1351.1377,13.1563,90.0070, 60},//intercars
      {"Sentinel", 0, 405, 1, 7000, 782.7794,-1355.7322,13.4149,89.8399, 60},//./intercars
      {"Admiral", 0, 445, 1, 5500, 782.9748,-1360.1450,13.4150,89.6007, 60},//intercars
      {"washington", 0, 421, 1, 13000, 783.5271,-1364.5712,13.4232,91.6611, 60},//intercars
      {"Bobcat", 0, 422, 1, 10000, 783.1122,-1369.0377,13.5270,89.9691, 60},//intercars
      {"Clover", 0, 542, 1, 2500,783.5627,-1373.9526,13.3279,92.3430, 60},//intercars
      {"Previon", 0, 436, 1, 6000, 783.2434,-1378.3967,13.4111,89.9667, 60},//intercars
      {"Camper", 0, 483, 1, 14000,763.3348,-1381.4042,13.6537,267.8404, 60},//intercars
      {"Burrito", 0, 482, 1, 9500, 763.8856,-1376.6637,13.7247,267.4547, 60},//intercars
      {"Hustler", 0, 545, 1, 28000, 764.4372,-1372.2225,13.3568,269.7708, 60},//intercars
      {"Esperanto", 0, 419, 1, 13000, 763.5831,-1368.0787,13.3160,269.6594, 60},//intercars
      {"Moonbeam", 0, 418, 1, 9000, 763.5397,-1363.6735,13.6152,269.9270, 60}//intercars
      };

    wenn einer das weiß bitte helfen


    • forward OnPlayerBuyCar(playerid, Model, Preis, cAutohaus, tank);



      for(new a=0;a<sizeof(Kaufliste);a++)
      {
      Kaufliste[a][Carid]=CreateVehicle(Kaufliste[a][Modelid],Kaufliste[a][CarPos_x], Kaufliste[a][CarPos_y], Kaufliste[a][CarPos_z], Kaufliste[a[CarRotate]1,1,20);
      }



      new typ, string[128];
      typ=IsAutohausCar(vehicleid);
      if(typ!=-1)
      {
      FreezePlayer(playerid);
      Spectating[playerid][0]=typ;
      format(string, sizeof(string), "{40A5FE}Fahrzeug:{FFFFFF}\t %s\n{40A5FE}Preis:{FFFFFF}\t\t $%d\n{40A5FE}Tank:{FFFFFF}\t\t %d", Kaufliste[typ] [Name], Kaufliste[typ][aPreis],Kaufliste[typ][Tank]);
      ShowPlayerDialog(playerid, DIALOG_SELLCAR, DIALOG_STYLE_MSGBOX, "{FFFFFF}Autohaus", string, "Kaufen", "Abbrechen");
      }




      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)
      {
      print("D5");
      //new autohaus=Kaufliste[Spectating[playerid][0]][Autohaus];
      GivePlayerCash(playerid, -preis);
      print("D6");
      new prname[MAX_PLAYER_NAME], str[128];
      GetPlayerName(playerid, prname, sizeof name);
      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, "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]][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*/
      SetVehicleNumberPlate(PlayerCar[playerid][PlayerKey[playerid]][CarId], SpielerName(playerid));
      RemovePlayerFromVehicle(playerid);
      print("D10");
      FreezePlayer(playerid);
      print("D11");
      UnfreezePlayer(playerid);
      print("D12");
      PlayerHaveCar[playerid][PlayerKey[playerid]] = 1;
      }
      else
      {
      SendClientMessage(playerid, COLOR_WEISS, "Du hast nicht genügend Geld dabei!");
      FreezePlayer(playerid);
      RemovePlayerFromVehicle(playerid);
      UnfreezePlayer(playerid);
      return 1;
      }
      }
      else
      {
      FreezePlayer(playerid);
      RemovePlayerFromVehicle(playerid);
      SendClientMessage(playerid, COLOR_WEISS, "Auf diesem Schlüssel ist bereits ein Fahrzeug!");
      UnfreezePlayer(playerid);
      return 1;
      }
      }
      }
      if(!response)
      {
      FreezePlayer(playerid);
      RemovePlayerFromVehicle(playerid);
      UnfreezePlayer(playerid);
      return 1;
      }
      }




      /*public OnPlayerBuyCar(playerid, Model, Preis, cAutohaus, tank)
      {
      if(IsPlayerConnected(playerid))
      {
      GivePlayerCash(playerid, -Preis);
      new name[MAX_PLAYER_NAME], str[128];
      GetPlayerName(playerid, name, sizeof(name));
      format(str, sizeof(str), "/Autos/%s_Car_%d.ini", name, 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);
      if(cAutohaus == 0)//Intercars
      {
      format(var, 32, "CarPos_x=%.3f\n",744.7441);fwrite(hFile, var);
      format(var, 32, "CarPos_y=%.3f\n",-1345.2749);fwrite(hFile, var);
      format(var, 32, "CarPos_z=%.3f\n",13.2438);fwrite(hFile, var);
      format(var, 32, "CarRotate=%.3f\n",271.8782);fwrite(hFile, var);
      }
      else if(cAutohaus == 1)//Grottis
      {
      format(var, 32, "CarPos_x=%.3f\n",550.6537);fwrite(hFile, var);
      format(var, 32, "CarPos_y=%.3f\n",-1264.4824);fwrite(hFile, var);
      format(var, 32, "CarPos_z=%.3f\n",16.9693);fwrite(hFile, var);
      format(var, 32, "CarRotate=%.3f\n",135.6086);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, "Tank=%d\n", tank);fwrite(hFile, var);
      format(var, 32, "MaxTank=%d\n", tank);fwrite(hFile, var);
      fclose(hFile);
      }
      OnPlayerCarLogin(playerid);
      }
      }*/





    WOW Tolle hilfe hahaha