jetzt wird aber das kennzeichen nicht übernommen aufs Fahrzeug
Beiträge von BloodDragon0608
-
-
ich habe es jetzt so gemacht wie ihr es gesagt habt
Code
Alles anzeigenif(dialogid == Fmeldeamt) { if(response==1) { if(IsPlayerInAnyVehicle(playerid) == 1) { if(Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]]) { if(strlen(inputtext) == 2) { if(!IsNumeric(inputtext)) return SendClientMessage(playerid,0xFF0000FF,"Die Zeichen dürfen nur aus Zahlen bestehen!"); if(ON_KZExistiert(inputtext)) return SendClientMessage(playerid,0xFF0000FF,"Dieses Kennzeichen ist bereits vergeben!"); new CarPlate[20], string[250]; format(CarPlate,sizeof(CarPlate),""#SERVERTAG"-SA-%d",strval(inputtext)); new vehiclefid = GetPlayerVehicleID(playerid); SetVehicleNumberPlate(vehiclefid, CarPlate); format(string, sizeof(string), "Du hast dein Fahrzeug dieses Kennzeichen %s gegeben.", CarPlate); SendClientMessage(playerid, COLOR_LIGHTGREEN12, string); SetVehiclePos(vehiclefid,1026.0601, -1439.0428, 13.3499); SetVehicleZAngle(playerid, 90); PutPlayerInVehicle(playerid,vehiclefid,0); KennzeichenErlaubnis[playerid] = 0; new name[MAX_PLAYER_NAME], str[128]; GetPlayerName(playerid, name, sizeof name); format(str, sizeof str, "/Privatcars/%s%d.dtcar", name,Dtc_PlayerKey[playerid]); dini_Set(str, "Kennzeichen", CarPlate); for(new x = 0; x < MaxVeh; x++) { strmid(PlayerCar[playerid][x][CarNumber], CarPlate, 0, strval(CarPlate), 255); PlayerCar[playerid][x][CarPlaten] = 1; } } else { ShowPlayerDialog(playerid,Fmeldeamt,DIALOG_STYLE_INPUT,"Nummernschild vergabe","Du kannst nicht mehr als 2 Zahlen nehmen\nNutze die Vorlage: "#SERVERTAG"-SA-xx\nVerwende die x als deine Zeichen.","Auswählen","Abbrechen"); } } } else { SendClientMessage(playerid,COLOR_GREEN,"Du musst dafür in einem Auto sitzen."); } } if(response==0) { SendClientMessage(playerid, COLOR_RED , " *************************************************** "); SendClientMessage(playerid, COLOR_RED , " * Du brauchst ein Kennzeichen * "); SendClientMessage(playerid, COLOR_RED , " * Damit du keine Anzeige bekommst * "); SendClientMessage(playerid, COLOR_RED , " *************************************************** "); return 1; } return 1; }
-
-
strlen ist die falsche Funktion. Nutze dafür strval.
strlen gibt nämlich die Anzahl der Zeichen im String wieder, strval konvertiert den String in Integer.
so jetzt sagt er mir an "Du kannst deim Fahrzeug nun ein Nummernschild geben\nNutze die Vorlage: "#SERVERTAG"-SA-xx\nVerwende die x als deine Zeichen" dabei habe ich noch nicht mal eins
-
Hallo Community
wenn ich mir ein Kennzeichen kaufen will steht dann an jedes Fahrzeug das kennzeichen "ABC-SA-2"
auch wenn man als zahl 55 eingibt steht "ABC-SA-2" aufen KennzeichenCode
Alles anzeigenif(dialogid == Fmeldeamt) { if(response==1) { if(IsPlayerInAnyVehicle(playerid) == 1) { if(Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]]) { if(strlen(inputtext) == 2) { if(!IsNumeric(inputtext)) return SendClientMessage(playerid,0xFF0000FF,"Die Zeichen dürfen nur aus Zahlen bestehen!"); if(ON_KZExistiert(inputtext)) return SendClientMessage(playerid,0xFF0000FF,"Dieses Kennzeichen ist bereits vergeben!"); new CarPlate[10]; format(CarPlate,sizeof(CarPlate),""#SERVERTAG"-SA-%d",strlen(inputtext)); new vehiclefid = GetPlayerVehicleID(playerid); SetVehicleNumberPlate(vehiclefid, CarPlate); SetVehiclePos(vehiclefid,1026.0601, -1439.0428, 13.3499); SetVehicleZAngle(playerid, 90); PutPlayerInVehicle(playerid,vehiclefid,0); KennzeichenErlaubnis[playerid] = 0; new name[MAX_PLAYER_NAME], str[128]; GetPlayerName(playerid, name, sizeof name); format(str, sizeof str, "/Privatcars/%s%d.dtcar", name,Dtc_PlayerKey[playerid]); dini_Set(str, "Kennzeichen", CarPlate); for(new x = 0; x < MaxVeh; x++) { strmid(PlayerCar[playerid][x][CarNumber], CarPlate, 0, strlen(CarPlate), 255); PlayerCar[playerid][x][CarPlaten] = 1; } } else { ShowPlayerDialog(playerid,Fmeldeamt,DIALOG_STYLE_INPUT,"Nummernschild vergabe","Du kannst deim Fahrzeug nun ein Nummernschild geben\nNutze die Vorlage: "#SERVERTAG"-SA-xx\nVerwende die x als deine Zeichen.","Auswählen","Abbrechen"); } } } else { SendClientMessage(playerid,COLOR_GREEN,"Du musst dafür in einem Auto sitzen."); } } if(response==0) { SendClientMessage(playerid, COLOR_RED , " *************************************************** "); SendClientMessage(playerid, COLOR_RED , " * Du brauchst ein Kennzeichen * "); SendClientMessage(playerid, COLOR_RED , " * Damit du keine Anzeige bekommst * "); SendClientMessage(playerid, COLOR_RED , " *************************************************** "); return 1; } return 1; }
-
Hallo Community
ich habe ein debug meldung und bekomme den nicht weg
C[13:49:30] [debug] Run time error 4: "Array index out of bounds" [13:49:30] [debug] Accessing element at index 42 past array upper bound 2 [13:49:30] [debug] AMX backtrace: [13:49:30] [debug] #0 000da2e8 in public OnPlayerStateChange (playerid=4, newstate=2, oldstate=1) at C:\Users\Paddy\Desktop\German of Life 7777\gamemodes\German-of-Life.pwn:18194
hier die zeileCode
Alles anzeigenif(newstate == PLAYER_STATE_DRIVER) {// 38 / 49 / 56 = SS new newcar = GetPlayerVehicleID(playerid); TelePos[playerid][0] = 0.0; TelePos[playerid][1] = 0.0; if(Parkkralle[newcar] == 1 || PlayerCar[playerid][newcar][Kralle] == 1)//zeile 18194 { if(!IsPlayerInFrac(playerid, 6) && JobDuty[playerid] == 0) { ShowPlayerDialog(playerid,DIALOG_Parkkralle,DIALOG_STYLE_MSGBOX,"Parkkralle","Willst du die Parkkralle freikaufen? Preis: 5000$","JA","NEiN");//DIALOG_Parkkralle } } }
-
Der heal und er tank wird nicht abgespeichert
kann mir da jemand helfen
Code
Alles anzeigenpublic SaveFactionCars(bool:destroy){ if(fexist(FACTION_CAR_FILE)) fremove(FACTION_CAR_FILE); new File:fFile=fopen(FACTION_CAR_FILE,io_append),Content[1024]; for(new fc;fc<sizeof(FactionCars);fc++){ new Float:health; GetVehicleHealth(FactionCars[fc][fCarid],health); FactionCars[fc][fCarHeal] = health;// Zeile 71423 FactionCars[fc][fCarTank] = Gas[FactionCars[fc][fCarid]]; if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){ format(Content,sizeof(Content),"%d %.3f %.3f %.3f %.3f %03d %03d %02d %02d %02d %02d %02d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %f\r\n", FactionCars[fc][fVehid], FactionCars[fc][fPos][0], FactionCars[fc][fPos][1], FactionCars[fc][fPos][2], FactionCars[fc][fPos][3], FactionCars[fc][fCol][0], FactionCars[fc][fCol][1], FactionCars[fc][fFaction][0], FactionCars[fc][fFaction][1], FactionCars[fc][fFaction][2], FactionCars[fc][fFaction][3], FactionCars[fc][fFaction][4], FactionCars[fc][fTuning][0], FactionCars[fc][fTuning][1], FactionCars[fc][fTuning][2], FactionCars[fc][fTuning][3], FactionCars[fc][fTuning][4], FactionCars[fc][fTuning][5], FactionCars[fc][fTuning][6], FactionCars[fc][fTuning][7], FactionCars[fc][fTuning][8], FactionCars[fc][fTuning][9], FactionCars[fc][fTuning][10], FactionCars[fc][fTuning][11], FactionCars[fc][fTuning][12], FactionCars[fc][fTuning][13], FactionCars[fc][fPrice], FactionCars[fc][fTankart], FactionCars[fc][fGesperrt], FactionCars[fc][fSperrpreis], FactionCars[fc][fMotorschaden], FactionCars[fc][fCarTank], FactionCars[fc][fCarHeal]); fwrite(fFile,Content); if(destroy == true){ if(DestroyVehicle(FactionCars[fc][fCarid])) FactionCars[fc][fCarid] = -255; } } }fclose(fFile); return true; }
-
Hallo Community
Vieleicht könnt ihr mir helfen.
Ich möchte gerne es so haben das der tank auch alle geht wenn der motor an ist aber keiner drin sitzt
was muss ich löschen??Code
Alles anzeigenpublic CheckGas() { for(new i=0;i<MAX_PLAYERS;i++) { new vehicle = GetPlayerVehicleID(i); new Model = GetVehicleModel(GetPlayerVehicleID(i)); if(Gas[vehicle] >= 1) { if(IsAPlane(vehicle) || IsABoat(vehicle) || Model == 462 || Model == 481) { Gas[vehicle]++; } new engine,lights,alarm,doors,bonnet,boot,objective; new vid = GetPlayerVehicleID(i); GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective); if(vid != INVALID_VEHICLE_ID) { if(engine == VEHICLE_PARAMS_ON) { if(SupCar[i] != 999) { Gas[vehicle] = GetGasMax(GetVehicleModel(vehicle)); } Gas[vehicle]--; } } } else { NoFuel[i] = 1; new engine,lights,alarm,doors,bonnet,boot,objective; new vid = GetPlayerVehicleID(i); GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective); GameTextForPlayer(i,"~w~~n~~n~~n~~n~~n~~n~~n~~n~Kein Benzin mehr~n~Gib /exit zum ausgestiegen ein",1500,3); } if(Gas[vehicle] > GetGasMax(GetVehicleModel(vehicle))) { Gas[vehicle] = GetGasMax(GetVehicleModel(vehicle)); } } return 1; }
-
Hallo Community
1. ich versuche es den Carheal zu ermitteln und von die 500$ abzurechen
2. ich versuche den Schaden zu ermitteln und auch von die 500$ abzurechen
(500$ sind die Kaution die man zahlt wenn man zum beispiel im Bus einsteigt)und da brauche ich hilfe weis nicht wo ich anfangen soll
Code
Alles anzeigen{ Tankpreis = 500 - BusTank; new JobCarid = GetPlayerVehicleID(playerid); new Float:JobCarHeal,JobCarTank,Busheal,BusTank; BusTank = (GetGasMax(GetVehicleModel(vehicle) -Gas[JobCarid])); new Tankpreis = (2 *BusTank); new Tankpreis = (2 *BusTank); Kautionen[JobCarid] = 0; SetPVarInt(playerid, "JobBusCarID", -1); DisablePlayerCheckpoint(playerid); }
-
stimmt das habe ich total vergessen danke
-
Hallo Community
ich habe 2 Warning´s und weis nicht was da falsch ist
CodeC:\Users\Paddy\Desktop\German of Life 7777\gamemodes\Live-your-Life.pwn(71367) : warning 213: tag mismatch C:\Users\Paddy\Desktop\German of Life 7777\gamemodes\Live-your-Life.pwn(71423) : warning 213: tag mismatch
hier die codes
Code
Alles anzeigenFunction OnPlayerCarUpdate2(playerid) { if(IsPlayerConnected(playerid)) { for(new x = 0; x < MaxVeh; x++) { if(Dtc_PlayerHaveCar[playerid][x]) { Dtc_Carlock[PlayerCar[playerid][x][CarId]] = 1; Dtc_LockCar(PlayerCar[playerid][x][CarId]); new string3[128]; new playername3[MAX_PLAYER_NAME]; new Float:health; GetVehicleHealth(PlayerCar[playerid][x][CarId],health); PlayerCar[playerid][x][CarHeal] = health;// Zeile 71367 GetPlayerName(playerid, playername3, sizeof(playername3)); format(string3, sizeof(string3), "/Privatcars/%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, "Gesperrt=%d\n",PlayerCar[playerid][x][CarGesperrt]);fwrite(hFile, var); format(var, 32, "Gesperrtpreis=%d\n",PlayerCar[playerid][x][CarSperrpreis]);fwrite(hFile, var); format(var, 32, "Kennzeichen=%s\n",PlayerCar[playerid][x][CarNumber]);fwrite(hFile, var); format(var, 32, "CarPlaten=%d\n",PlayerCar[playerid][x][CarPlaten]);fwrite(hFile, var); format(var, 32, "Kralle=%d\n",PlayerCar[playerid][x][Kralle]);fwrite(hFile, var); format(var, 32, "Motorschaden=%d\n",PlayerCar[playerid][x][CarMotorschaden]);fwrite(hFile, var); format(var, 32, "CarTankart=%d\n",PlayerCar[playerid][x][CarTankart]);fwrite(hFile, var); format(var, 32, "Neon=%d\n",PlayerCar[playerid][x][Neon]);fwrite(hFile, var); format(var, 32, "CarHeal=%d\n",PlayerCar[playerid][x][CarHeal]);fwrite(hFile, var); fclose(hFile); } } } } } Function OnPlayerCarUpdate(playerid) { if(IsPlayerConnected(playerid)) { for(new x = 0; x < MaxVeh; x++) { if(Dtc_PlayerHaveCar[playerid][x]) { Motorschaden[PlayerCar[playerid][x][CarId]] = 0; new Float:health; GetVehicleHealth(PlayerCar[playerid][x][CarId],health); PlayerCar[playerid][x][CarHeal] = health;// Zeile 71423 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), "/Privatcars/%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, "Gesperrt=%d\n",PlayerCar[playerid][x][CarGesperrt]);fwrite(hFile, var); format(var, 32, "Gesperrtpreis=%d\n",PlayerCar[playerid][x][CarSperrpreis]);fwrite(hFile, var); format(var, 32, "Kennzeichen=%s\n",PlayerCar[playerid][x][CarNumber]);fwrite(hFile, var); format(var, 32, "CarPlaten=%d\n",PlayerCar[playerid][x][CarPlaten]);fwrite(hFile, var); format(var, 32, "Kralle=%d\n",PlayerCar[playerid][x][Kralle]);fwrite(hFile, var); format(var, 32, "Motorschaden=%d\n",PlayerCar[playerid][x][CarMotorschaden]);fwrite(hFile, var); format(var, 32, "CarTankart=%d\n",PlayerCar[playerid][x][CarTankart]);fwrite(hFile, var); format(var, 32, "Neon=%d\n",PlayerCar[playerid][x][Neon]);fwrite(hFile, var); format(var, 32, "CarHeal=%d\n",PlayerCar[playerid][x][CarHeal]);fwrite(hFile, var); fclose(hFile); } } } } }
-
Beim Laden der Fahrzeuge soll dann der Preis wieder ermittelt werden, so wie das aussieht, oder?
Der Preis soll anhand der Model ID gefunden werden? Oder kann es vorkommen, dass in der FactionBuylist ein Model zwei mal vorkommt?
ja der Preis soll wen er auf 0 steht ermittelt werden und ersetzt
Ne es gibt nur von jede Marke 1 Model
PS. Sorry schreibe mit Handy
-
Wie ist denn FactionBuylist deklariert, und wie sehen die Werte dazu aus?
hier
Code
Alles anzeigenenum fBuylist{ fbVehid, Float:fbX, Float:fbY, Float:fbZ, Float:fbA, fbPrice, fbCarid, Text3D:fbLabel }; new FactionBuylist[][fBuylist] = { {585,-1991.3865,243.6428,34.7629,247.8219,10000}, // Emperor {559,-1991.5856,250.2707,34.8282,229.9803,80000}, // Jester {547,-1990.6599,255.5497,34.8964,231.0674,19000}, // Primo {542,-1989.8329,261.5486,34.9105,238.4741,8000}, // Clover {541,-1989.7517,267.1880,34.8260,236.2366,250000},// Bullet {533,-1988.5706,272.0869,34.8873,238.7786,15000}, // Feltzer {482,-1970.4788,301.5517,35.3205,121.0440,17000}, // Burrito {445,-1970.8176,285.2407,35.0583,63.6937,18000}, // Admiral {554,-1971.4727,272.4672,35.2437,68.1677,35000}, // Yosemite {480,-1973.0607,266.9261,34.9475,73.4934,64000}, // Comet {566,-1971.8235,260.9345,34.9495,70.5469,23000}, // Tahoma {567,-1970.9380,255.6773,35.0409,75.7004,24000}, // Savanna {562,-1953.7753,297.9956,35.1307,123.9488,210000}, // Elegy {561,-1953.7380,292.5417,35.2877,130.8867,280000}, // Stratum {489,-1961.8400,271.2697,35.6174,308.9677,35000}, // Rancher {507,-1961.7737,262.3957,35.3035,311.1499,27000}, // Elegant {580,-1960.5553,257.7931,35.2652,317.1589,33000}, // Stafford {412,-1946.4807,260.6360,35.2870,63.3573,26000}, // voodoo {458,-1947.3090,265.4138,35.3534,66.2263,38000}, // solair {419,-1946.4308,270.2329,35.3012,69.9598,26000}, // Esperanto {409,-1955.2946,304.1807,40.8489,218.0704,750000}, // Stretch {603,-1952.1052,293.6208,40.9016,177.6088,225000}, // Phoenix {579,-1957.6937,293.1114,40.9840,181.6542,88000}, // Huntley {463,-1957.7611,286.9698,40.5830,231.6342,110000}, // Freeway {468,-1957.4913,284.2999,40.7091,233.1000,115000}, // Sanchez {461,-1957.9886,281.4260,40.6230,233.9838,119000}, // PCJ-6004 {521,-1957.9189,278.3181,40.6126,227.4523,128000}, // FCR-900 {602,-1957.6244,272.0718,40.8505,182.4836,96000}, // Alpha {518,-1955.0873,257.1152,40.7202,345.2345,33000}, // Puccaneer {411,-1946.2557,257.3233,40.7618,53.3545,500000}, // Infernus {576,-1946.0646,264.3328,40.6460,69.0697,44000}, // Tornado {560,-1945.5096,270.4185,40.7809,89.9338,300000}, // Sultan {600,-1937.1012,270.8874,40.7871,244.7183,45000}, // Picador {575,-1937.2255,259.3284,40.6387,240.7499,29000}, // Broadway {487,-1959.1997,300.3640,35.5802,135.1779,10000000}//Heli }; new Float:FactionBuySpawn[4]={-1916.5936,293.0312,41.2238,180.0000}; enum fCar{ fCarid, fVehid, Float:fPos[4], fCol[2], fFaction[5], fTuning[14], fPrice, fTankart, fGesperrt, fMotorschaden, fSperrpreis, #if defined FACTION_CARS_LOCKABLE bool:fLock #endif }; new FactionCars[MAX_FACTION_CARS][fCar];
-
Poste bitte deine Zeile 76691 aus der Funktion LoadFactionCars.
Eventuell ein paar Zeilen drum herum, und markiere dann die Zeile 76691.Du sprengst dort ein Array, das mit 35 Indizes deklariert wurde (0 - 34) mit dem Index 35.
Das dortige Array muss vergrößert werden.
hierCode
Alles anzeigenpublic LoadFactionCars(){ if(!fexist(FACTION_CAR_FILE)){ new File:tfFile=fopen(FACTION_CAR_FILE,io_write); fclose(tfFile); } for(new fbl;fbl<sizeof(FactionBuylist);fbl++){ new File:fFile=fopen(FACTION_CAR_FILE,io_read),Content[1024],fc; while(fread(fFile,Content) && fc<sizeof(FactionCars)){ sscanf(Content,"dffffdddddddddddddddddddddddddd", FactionCars[fc][fVehid], FactionCars[fc][fPos][0], FactionCars[fc][fPos][1], FactionCars[fc][fPos][2], FactionCars[fc][fPos][3], FactionCars[fc][fCol][0], FactionCars[fc][fCol][1], FactionCars[fc][fFaction][0], FactionCars[fc][fFaction][1], FactionCars[fc][fFaction][2], FactionCars[fc][fFaction][3], FactionCars[fc][fFaction][4], FactionCars[fc][fTuning][0], FactionCars[fc][fTuning][1], FactionCars[fc][fTuning][2], FactionCars[fc][fTuning][3], FactionCars[fc][fTuning][4], FactionCars[fc][fTuning][5], FactionCars[fc][fTuning][6], FactionCars[fc][fTuning][7], FactionCars[fc][fTuning][8], FactionCars[fc][fTuning][9], FactionCars[fc][fTuning][10], FactionCars[fc][fTuning][11], FactionCars[fc][fTuning][12], FactionCars[fc][fTuning][13], FactionCars[fc][fTankart], FactionCars[fc][fGesperrt], FactionCars[fc][fSperrpreis], FactionCars[fc][fMotorschaden]); if(FactionCars[fc][fPrice] == 0) { FactionCars[fc][fPrice] = FactionBuylist[fc][fbPrice];//76691 } if(FactionCars[fc][fMotorschaden] == 1) { Motorschaden[FactionCars[fc][fCarid]] = 1; SetVehicleHealth(FactionCars[fc][fCarid], 350); }
-
Könntest du bitte einmal die ganze Serverlog Posten.... mit Server start blabla.. und nicht nur vom debug modus...
hier der ganze Server-log
C
Alles anzeigen---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3.7-R2, (C)2005-2015 SA-MP Team [21:33:36] [21:33:36] Server Plugins [21:33:36] -------------- [21:33:36] Loading plugin: crashdetect.so [21:33:36] CrashDetect v4.15.1 is OK. [21:33:36] Loaded. [21:33:36] Loading plugin: streamer.so [21:33:36] *** Streamer Plugin v2.8.2 by Incognito loaded *** [21:33:36] Loaded. [21:33:36] Loading plugin: sscanf.so [21:33:36] [21:33:36] =============================== [21:33:36] sscanf plugin loaded. [21:33:36] Version: 2.8.2 [21:33:36] (c) 2012 Alex "Y_Less" Cole [21:33:36] =============================== [21:33:36] Loaded. [21:33:36] Loading plugin: mysql_static.so [21:33:36] >> plugin.mysql: R39-6 successfully loaded. [21:33:36] Loaded. [21:33:36] Loaded 4 plugins. [21:33:36] [21:33:36] Ban list [21:33:36] -------- [21:33:36] Loaded: samp.ban [21:33:36] [21:33:36] [21:33:36] Filterscripts [21:33:36] --------------- [21:33:36] Loaded 0 filterscripts. [21:33:36] [MySQL] Verbindungsaufbau... [21:33:36] [MySQL] Die Verbindung zur Datenbank wurde erfolgreich hergestellt! Handle: 1 [21:33:36] [debug] Run time error 4: "Array index out of bounds" [21:33:36] [debug] Accessing element at index 35 past array upper bound 34 [21:33:36] [debug] AMX backtrace: [21:33:36] [debug] #0 004ec774 in public LoadFactionCars () at C:\Users\Paddy\Desktop\German of Life 7777\gamemodes\German-of-Life.pwn:76691 [21:33:36] [debug] #1 004e6118 in public START_FRAC () at C:\Users\Paddy\Desktop\German of Life 7777\gamemodes\German-of-Life.pwn:76402 [21:33:36] [debug] #2 00102b10 in public Itter_OnGameModeInit () at C:\Users\Paddy\Desktop\German of Life 7777\gamemodes\German-of-Life.pwn:20767 [21:33:36] [debug] #3 native CallLocalFunction () from samp03svr [21:33:36] [debug] #4 0000955c in public OnGameModeInit () at C:\Users\Paddy\Desktop\German of Life 7777\pawno\include\foreach.inc:667 [21:33:36] _______________________________________ [21:33:36] Das Script wurde Vollständig geladen! [21:33:36] Script by Live your Life [21:33:36] ______________________________________ [21:33:36] [21:33:36] Number of vehicle models: 22
-
Lade dir das crashdetect Plugin herunter und füge es in deinen Server ein. Dann poste was im Server Log steht, wenn du den Server startest.
das steht da
C[21:33:36] [debug] Run time error 4: "Array index out of bounds" [21:33:36] [debug] Accessing element at index 35 past array upper bound 34 [21:33:36] [debug] AMX backtrace: [21:33:36] [debug] #0 004ec774 in public LoadFactionCars () at C:\Users\Paddy\Desktop\German of Life 7777\gamemodes\German-of-Life.pwn:76691 [21:33:36] [debug] #1 004e6118 in public START_FRAC () at C:\Users\Paddy\Desktop\German of Life 7777\gamemodes\German-of-Life.pwn:76402 [21:33:36] [debug] #2 00102b10 in public Itter_OnGameModeInit () at C:\Users\Paddy\Desktop\German of Life 7777\gamemodes\German-of-Life.pwn:20767 [21:33:36] [debug] #3 native CallLocalFunction () from samp03svr [21:33:36] [debug] #4 0000955c in public OnGameModeInit () at C:\Users\Paddy\Desktop\German of Life 7777\pawno\include\foreach.inc:667
-
Hallo Breadfish
Ich habe seit gestern Abend ein großes Problem.
Es steht bei Mode : Unknown
aber es lädt alles auser die Objekten und die Bots Connecten nichtworan kann es liegen ??
habe alles was ich gestern gemacht habe gelöscht aber es steht immer noch Unknown