Was wird dir so im Server Log ausgegeben?
public PlayerCarConnect(playerid)
{
printf("Starte PlayerCarConnect für %d (MySQL = %d)", playerid, SaveServerMySQL);
if(IsPlayerNPC(playerid))
{
printf("NPC");
return 1;
}
new string[128],
playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
for(new h = 0; h < MaxVeh[playerid]; h++)
{
printf("h: %d", h);
if(SaveServerMySQL==0)
{
format(string, sizeof(string), "cars/%dAutoNR%d.ini", PlayerInfo[playerid][pSQLID], h);
if(fexist(string))
{
new data[256];
data = dini_Get(string,"AH_Typ"); Carlist[playerid][h][Typ] = strval( data );
data = dini_Get(string,"AH_X"); Carlist[playerid][h][pos_x] = floatstr( data );
data = dini_Get(string,"AH_Y"); Carlist[playerid][h][pos_y] = floatstr( data );
data = dini_Get(string,"AH_Z"); Carlist[playerid][h][pos_z] = floatstr( data );
data = dini_Get(string,"AH_Rot"); Carlist[playerid][h][z_angle] = floatstr( data );
data = dini_Get(string,"AH_Status"); Carlist[playerid][h][Status] = strval( data );
data = dini_Get(string,"AH_Lock"); Carlist[playerid][h][Lock] = strval( data );
data = dini_Get(string,"AH_Paintjob"); Carlist[playerid][h][Paintjob] = strval( data );
data = dini_Get(string,"AH_Farbe1"); Carlist[playerid][h][Farbe1] = strval( data );
data = dini_Get(string,"AH_Farbe2"); Carlist[playerid][h][Farbe2] = strval( data );
data = dini_Get(string,"AH_mod1"); Carlist[playerid][h][mod1] = strval( data );
data = dini_Get(string,"AH_mod2"); Carlist[playerid][h][mod2] = strval( data );
data = dini_Get(string,"AH_mod3"); Carlist[playerid][h][mod3] = strval( data );
data = dini_Get(string,"AH_mod4"); Carlist[playerid][h][mod4] = strval( data );
data = dini_Get(string,"AH_mod5"); Carlist[playerid][h][mod5] = strval( data );
data = dini_Get(string,"AH_mod6"); Carlist[playerid][h][mod6] = strval( data );
data = dini_Get(string,"AH_mod7"); Carlist[playerid][h][mod7] = strval( data );
data = dini_Get(string,"AH_mod8"); Carlist[playerid][h][mod8] = strval( data );
data = dini_Get(string,"AH_mod9"); Carlist[playerid][h][mod9] = strval( data );
data = dini_Get(string,"AH_mod10"); Carlist[playerid][h][mod10] = strval( data );
data = dini_Get(string,"AH_mod11"); Carlist[playerid][h][mod11] = strval( data );
data = dini_Get(string,"AH_mod12"); Carlist[playerid][h][mod12] = strval( data );
data = dini_Get(string,"AH_mod13"); Carlist[playerid][h][mod13] = strval( data );
data = dini_Get(string,"AH_mod14"); Carlist[playerid][h][mod14] = strval( data );
data = dini_Get(string,"AH_mod15"); Carlist[playerid][h][mod15] = strval( data );
data = dini_Get(string,"AH_mod16"); Carlist[playerid][h][mod16] = strval( data );
data = dini_Get(string,"AH_mod17"); Carlist[playerid][h][mod17] = strval( data );
data = dini_Get(string,"AH_SpawnSaveX"); Carlist[playerid][h][SpawnSaveX] = floatstr( data );
data = dini_Get(string,"AH_SpawnSaveY"); Carlist[playerid][h][SpawnSaveY] = floatstr( data );
data = dini_Get(string,"AH_SpawnSaveZ"); Carlist[playerid][h][SpawnSaveZ] = floatstr( data );
data = dini_Get(string,"AH_SpawnSaveRot"); Carlist[playerid][h][SpawnSaveRot] = floatstr( data );
data = dini_Get(string,"AH_TankVolumen"); Carlist[playerid][h][TankVolumen] = strval( data );
data = dini_Get(string,"AH_RepairTime"); Carlist[playerid][h][RepairTime] = strval(data);
data = dini_Get(string,"AH_Versicherung"); Carlist[playerid][h][Versicherung] = strval(data);
data = dini_Get(string,"AH_StandTime"); Carlist[playerid][h][StandTime] = strval(data);
data = dini_Get(string,"AH_Meter"); Carlist[playerid][h][Meter] = strval(data);
}
}
else
{
format(string, sizeof(string),"SELECT * FROM `usercars` WHERE `Name` = '%dAutoNR%d'",PlayerInfo[playerid][pSQLID], h);
printf("string = %s", string);
self_mysql_queryEx(string);
mysql_store_result(MySQLConnection);
printf("rows: %d", mysql_num_rows(MySQLConnection));
if(mysql_num_rows(MySQLConnection) != 0)
{
printf("Starte Laden der Daten...");
mysql_fetch_row_format(string);
new val[ 256 ];
self_mysql_get_field("AH_Typ", val); Carlist[playerid][h][Typ] = strval( val );
self_mysql_get_field("AH_X", val); Carlist[playerid][h][pos_x] = floatstr( val );
self_mysql_get_field("AH_Y", val); Carlist[playerid][h][pos_y] = floatstr( val );
self_mysql_get_field("AH_Z", val); Carlist[playerid][h][pos_z] = floatstr( val );
self_mysql_get_field("AH_Rot", val); Carlist[playerid][h][z_angle] = floatstr( val );
self_mysql_get_field("AH_Status", val); Carlist[playerid][h][Status] = strval( val );
self_mysql_get_field("AH_Lock", val); Carlist[playerid][h][Lock] = strval( val );
self_mysql_get_field("AH_Paintjob", val); Carlist[playerid][h][Paintjob] = strval( val );
self_mysql_get_field("AH_Farbe1", val); Carlist[playerid][h][Farbe1] = strval( val );
self_mysql_get_field("AH_Farbe2", val); Carlist[playerid][h][Farbe2] = strval( val );
self_mysql_get_field("AH_mod1", val); Carlist[playerid][h][mod1] = strval( val );
self_mysql_get_field("AH_mod2", val); Carlist[playerid][h][mod2] = strval( val );
self_mysql_get_field("AH_mod3", val); Carlist[playerid][h][mod3] = strval( val );
self_mysql_get_field("AH_mod4", val); Carlist[playerid][h][mod4] = strval( val );
self_mysql_get_field("AH_mod5", val); Carlist[playerid][h][mod5] = strval( val );
self_mysql_get_field("AH_mod6", val); Carlist[playerid][h][mod6] = strval( val );
self_mysql_get_field("AH_mod7", val); Carlist[playerid][h][mod7] = strval( val );
self_mysql_get_field("AH_mod8", val); Carlist[playerid][h][mod8] = strval( val );
self_mysql_get_field("AH_mod9", val); Carlist[playerid][h][mod9] = strval( val );
self_mysql_get_field("AH_mod10", val); Carlist[playerid][h][mod10] = strval( val );
self_mysql_get_field("AH_mod11", val); Carlist[playerid][h][mod11] = strval( val );
self_mysql_get_field("AH_mod12", val); Carlist[playerid][h][mod12] = strval( val );
self_mysql_get_field("AH_mod13", val); Carlist[playerid][h][mod13] = strval( val );
self_mysql_get_field("AH_mod14", val); Carlist[playerid][h][mod14] = strval( val );
self_mysql_get_field("AH_mod15", val); Carlist[playerid][h][mod15] = strval( val );
self_mysql_get_field("AH_mod16", val); Carlist[playerid][h][mod16] = strval( val );
self_mysql_get_field("AH_mod17", val); Carlist[playerid][h][mod17] = strval( val );
self_mysql_get_field("AH_SpawnSaveX", val); Carlist[playerid][h][SpawnSaveX] = floatstr( val );
self_mysql_get_field("AH_SpawnSaveY", val); Carlist[playerid][h][SpawnSaveY] = floatstr( val );
self_mysql_get_field("AH_SpawnSaveZ", val); Carlist[playerid][h][SpawnSaveZ] = floatstr( val );
self_mysql_get_field("AH_SpawnSaveRot", val); Carlist[playerid][h][SpawnSaveRot] = floatstr( val );
self_mysql_get_field("AH_TankVolumen", val); Carlist[playerid][h][TankVolumen] = strval( val );
self_mysql_get_field("AH_RepairTime", val); Carlist[playerid][h][RepairTime] = strval( val );
self_mysql_get_field("AH_Versicherung", val); Carlist[playerid][h][Versicherung] = strval( val );
self_mysql_get_field("AH_StandTime", val); Carlist[playerid][h][StandTime] = strval( val );
self_mysql_get_field("AH_Meter", val); Carlist[playerid][h][Meter] = strval( val );
printf("Laden der Daten beendet.");
}
mysql_free_result(MySQLConnection);
printf("Result frei.");
}
if(Carlist[playerid][h][Typ] != -1 && Carlist[playerid][h][Status] == 0)
{
printf("Fahrzeugspeicherung: Beginning Spawn.");
Carlist[playerid][h][Carid] = CreateTunedCar(playerid, h);
printf("Fahrzeugspeicherung: End Spawn (%d).", Carlist[playerid][h][Carid]);
}
printf("Durch.");
}
printf("Alle Fahrzeuge wurden erfolgreich geladen. Beende Funktion.");
return 1;
}
Privatautohaus Speicherung
- Entire-Reallife
- Geschlossen
- Erledigt
-
-
Das spuckt die Log aus:
[19:26:48] [join] JasoN.DINO has joined the server (7:87.158.226.232)
[19:27:00] Starte PlayerCarConnect für 7 (MySQL = 1)
[19:27:00] h: 0
[19:27:00] string = SELECT * FROM `usercars` WHERE `Name` = '111AutoNR0'
[19:27:00] rows: 1
[19:27:00] Starte Laden der Daten...
[19:27:00] Laden der Daten beendet.
[19:27:00] Result frei.
[19:27:00] Fahrzeugspeicherung: Beginning Spawn.
[19:27:00] Fahrzeugspeicherung: End Spawn (-1).
[19:27:00] Durch.
[19:27:00] Alle Fahrzeuge wurden erfolgreich geladen. Beende Funktion.
[19:27:00] [debug] Run time error 5: "Invalid memory access"
[19:27:00] [debug] AMX backtrace:
[19:27:00] [debug] #0 00000074 in public OnDialogResponse () from revolution.amx -
Füge bitte beim Login vor und nach der Erstellung der Fahrzeuge einen print ein:
printf("Im Login vor PlayerCarConnect");
PlayerCarConnect(playerid);
printf("Im Login nach PlayerCarConnect");
SpawnPlayer(playerid);
printf("Nach SpawnPlayer");Was wird dann geprintet?
-
Daran sieht man das nach OnPlayerConnectCar nichts mehr passiert.
C
Alles anzeigen[22:17:22] Im Login vor PlayerCarConnect [22:17:22] Starte PlayerCarConnect für 8 (MySQL = 1) [22:17:22] h: 0 [22:17:22] string = SELECT * FROM `usercars` WHERE `Name` = '111AutoNR0' [22:17:22] rows: 1 [22:17:22] Starte Laden der Daten... [22:17:22] Laden der Daten beendet. [22:17:22] Result frei. [22:17:22] Fahrzeugspeicherung: Beginning Spawn. [22:17:22] Fahrzeugspeicherung: End Spawn (-1). [22:17:22] Durch. [22:17:22] Alle Fahrzeuge wurden erfolgreich geladen. Beende Funktion. [22:17:22] [debug] Run time error 5: "Invalid memory access" [22:17:22] [debug] AMX backtrace: [22:17:22] [debug] #0 00000074 in public OnDialogResponse () from revolution.amx
-
Interessant. Erklären kann ich mir den Fehler nicht, aber versuche mal folgendes:
PlayerCarConnect(playerid);
zu:
SetTimerEx("PlayerCarConnect", 100, false, "d", playerid);Geht es dann?
Das würde möglicherweise das Problem mit dem Memory Access umgehen. -
Ich spawne jetzt zwar nun jedoch lädt das Auto nicht:
Schau mal was die Log ausgibt: (Im Login vor PlayerCarConnect
[00:36:13] Im Login nach PlayerCarConnect
[00:36:13] Nach SpawnPlayer
[00:36:13] BlabLa hat sich eingeloggt. [ID: 7]
[00:36:13] Starte PlayerCarConnect für 7 (MySQL = 1)
[00:36:13] h: 0
[00:36:13] string = SELECT * FROM `usercars` WHERE `Name` = '111AutoNR0'
[00:36:13] rows: 1
[00:36:13] Starte Laden der Daten...
[00:36:13] Laden der Daten beendet.
[00:36:13] Result frei.
[00:36:13] Fahrzeugspeicherung: Beginning Spawn.
[00:36:13] Fahrzeugspeicherung: End Spawn (-1).
[00:36:13] Durch.
[00:36:13] Alle Fahrzeuge wurden erfolgreich geladen. Beende Funktion.
[00:36:13] [debug] Run time error 7: "Stack underflow"
[00:36:13] [debug] Stack pointer (STK) is 0x57A22C, stack top (STP) is 0x57A200
[00:36:13] [debug] AMX backtrace:
[00:36:13] [debug] #0 00000000 in public PlayerCarConnect () from revolution.amx -
"111AutoNR0" falsche psqlid
-
Zwecks der Fehlermeldung:
Versuche mal, das "return 1;" nach dieser Zeile zu entfernen:
printf("Alle Fahrzeuge wurden erfolgreich geladen. Beende Funktion.");
Zu den Fahrzeugen:
Das erkennt man auch daran, dass dein CreateTunedCar -1 zurück gibt, sprich es wurde kein Fahrzeug erstellt.
Poste die CreateTunedCar Funktion bitte mal und prüfe, wie viele Fahrzeuge du insgesamt im Server hast, nicht dass da das Limit erreicht ist. -
So wenn ich das return entferne dannn bekomm ich ein warning erstensmal und zweitens funktioniert es trotzdem nicht.
Ich habe hier mal den CreateTunedCar public für euch.Code
Alles anzeigenpublic CreateTunedCar(playerid, CarKey1) { if(IsPlayerConnected(playerid) && Carlist[playerid][CarKey1][Typ] != -1) { // new carid = CreateVehicle(Kaufliste[Carlist[playerid][CarKey1][Typ]][Modelid],Carlist[playerid][CarKey1][SpawnSaveX],Carlist[playerid][CarKey1][SpawnSaveY],Carlist[playerid][CarKey1][SpawnSaveZ],Carlist[playerid][CarKey1][SpawnSaveRot],-1,-1,-1); new carid = CreateVehicle(Kaufliste[Carlist[playerid][CarKey1][Typ]][Modelid],Carlist[playerid][CarKey1][pos_x],Carlist[playerid][CarKey1][pos_y],Carlist[playerid][CarKey1][pos_z],Carlist[playerid][CarKey1][z_angle],-1,-1,-1); new string[50]; format(string, sizeof(string), "{FFFF00}RR-{21DD00}%d", carid); SetVehicleNumberPlate(carid,string); Gas[carid] = Carlist[playerid][CarKey1][TankVolumen]; Locked[carid] = Carlist[playerid][CarKey1][Lock]; if(Carlist[playerid][CarKey1][Lock] == 1){ ForAllPlayers(i){ SetVehicleParamsForPlayer(carid,i,0,1); } } if(Carlist[playerid][CarKey1][mod1]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod1]); } if(Carlist[playerid][CarKey1][mod2]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod2]); } if(Carlist[playerid][CarKey1][mod3]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod3]); } if(Carlist[playerid][CarKey1][mod4]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod4]); } if(Carlist[playerid][CarKey1][mod5]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod5]); } if(Carlist[playerid][CarKey1][mod6]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod6]); } if(Carlist[playerid][CarKey1][mod7]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod7]); } if(Carlist[playerid][CarKey1][mod8]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod8]); } if(Carlist[playerid][CarKey1][mod9]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod9]); } if(Carlist[playerid][CarKey1][mod10]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod10]); } if(Carlist[playerid][CarKey1][mod11]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod11]); } if(Carlist[playerid][CarKey1][mod12]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod12]); } if(Carlist[playerid][CarKey1][mod13]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod13]); } if(Carlist[playerid][CarKey1][mod14]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod14]); } if(Carlist[playerid][CarKey1][mod15]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod15]); } if(Carlist[playerid][CarKey1][mod16]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod16]); } if(Carlist[playerid][CarKey1][mod17]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod17]); } if(Carlist[playerid][CarKey1][Paintjob]!=-1) { ChangeVehiclePaintjob(carid,Carlist[playerid][CarKey1][Paintjob]); } if(Carlist[playerid][CarKey1][Farbe1]!=-1) { ChangeVehicleColor(carid,Carlist[playerid][CarKey1][Farbe1],Carlist[playerid][CarKey1][Farbe2]); } return carid; } return -1; }
wenn ich return -1 auf return 1 setze geht es auch nicht.
mido: sqlid ist richtig. -
Ändere mal:
if(IsPlayerConnected(playerid) && Carlist[playerid][CarKey1][Typ] != -1)
zu:
printf("CreateTunedCar: Typ: %d", Carlist[playerid][CarKey1][Typ]);
if(IsPlayerConnected(playerid) && Carlist[playerid][CarKey1][Typ] != -1)
{
printf("Model: %d", Kaufliste[Carlist[playerid][CarKey1][Typ]][Modelid]);Was wird dir dann in dem ganzen Vorgang geprintet?
-
So jetzt wird es interessant:
C
Alles anzeigen[18:35:49] Im Login vor PlayerCarConnect [18:35:49] Starte PlayerCarConnect für 7 (MySQL = 1) [18:35:49] h: 0 [18:35:49] string = SELECT * FROM `usercars` WHERE `Name` = '111AutoNR0' [18:35:49] rows: 1 [18:35:49] Starte Laden der Daten... [18:35:49] Laden der Daten beendet. [18:35:49] Result frei. [18:35:49] Fahrzeugspeicherung: Beginning Spawn. [18:35:49] CreateTunedCar: Typ: 10 [18:35:49] Fahrzeugspeicherung: End Spawn (1). [18:35:49] Durch. [18:35:49] Alle Fahrzeuge wurden erfolgreich geladen. Beende Funktion. [18:35:49] [debug] Run time error 5: "Invalid memory access" [18:35:49] [debug] AMX backtrace: [18:35:49] [debug] #0 00000074 in public OnDialogResponse () from revolution.amx
Mode: %d fehlt.
Die ausgegebene Typ ID stimmt. -
Wie sieht deine Kaufliste aus?
-
C
Alles anzeigenenum ahModell { Name[128], Autohaus, Modelid, Carid, Preis, Reparatur, Float:pos_x, Float:pos_y, Float:pos_z, Float:z_angle, }; new Kaufliste[76][ahModell] = { {"Mesa",0,500,-1,400000,16000,783.0,-1335.0,13.2,121.1}, {"Feltzer",0,533,-1,300000,6000,783.0,-1340.0,13.2,121.1}, {"Windsor",0,555,-1,150000,10000,783.0,-1345.0,13.2,121.1}, {"Blade",0,536,-1,290000,5000,783.0,-1350.0,13.2,121.1}, {"Remington",0,534,-1,350000,19000,783.0,-1355.0,13.2,121.1}, {"Savanna",0,567,-1,400000,19000,783.0,-1360.0,13.2,121.1}, {"Slamvan",0,535,-1,250000,5000,783.0,-1365.0,13.2,121.1}, {"Voodoo",0,412,-1,350000,9000,783.0,-1370.0,13.2,121.1}, {"Huntley",0,579,-1,750000,15000,783.0,-1375.0,13.2,121.1}, {"Stratum",0,561,-1,920000,20000,783.0,-1380.0,13.2,121.1}, {"Clover",0,542,-1,25000,13000,765.0,-1360.0,13.4,301.1}, {"Glendale",0,466,-1,15000,2000,765.0,-1365.0,13.4,301.1},//HIER NET {"Elegy",0,562,-1,900000,17000,765.0,-1370.0,13.4,301.1}, {"Patriot",0,470,-1,5000000,30000,765.0,-1375.0,13.4,301.1}, {"Glendale",0,604,-1,27000,5000,2136.3101,-1133.5740,25.4356,28.0000}, {"Fortune",0,526,-1,500200,15000,765.0,-1380.0,13.4,301.1}, {"Sultan",0,560,-1,15000000,30000,766.0,-1333.0,13.3,211.1}, {"Vincent",0,540,-1,50000,1000,756.0,-1333.0, 13.3,211.1}, {"Sunrise",0,550,-1,600000,10000,761.0,-1333.0,13.3,211.1}, {"Alpha",0,602,-1,900000,20000,751.0,-1333.0,13.3,211.1}, {"Banshee",0,429,-1,3000000,25000,746.0,-1333.0,13.3,211.1}, {"Blista Compact",1,496,-1,2000500,25000,-1668.6447,1207.0372,7.0249,309.5959}, {"Buffalo",1,402,-1,4500000,30000,-1663.6709,1215.2883,7.0234,274.9868}, {"Bullet",1,541,-1,12000000,45000,-1651.3892,1210.3469,7.0208,281.3321}, {"Cheetah",1,415,-1,11000000,48000,-1671.5294,1206.1067,13.4442,259.1177}, {"Club",1,589,-1,6000000,44000,-1665.7789,1222.4406,13.4485,279.6459}, {"Euros",1,587,-1,6000000,39000,-1660.7256,1217.6407,13.4444,283.1553}, {"Infernus",1,411,-1,19500000,55000,-1653.2462,1210.7842,13.4460,266.7211}, {"Jester",1,559,-1,3500000,20000,-1676.0128,1207.1641,20.9248,261.5029}, {"Phoenix",1,603,-1,2500000,30000,-1664.4386,1206.8241,20.9289,332.5978}, {"FCR-900",1,521,-1,18500000,50000,-1649.5254,1206.8276,20.7056,42.7044}, {"Turismo",1,451,-1,18000000,41000,-1665.1248,1222.7113,20.9265,267.4103}, {"Premier",1,426,-1,2500000,30000,-1661.1943,1217.9629,20.9268,286.1662}, {"ZR-350",1,477,-1,14500000,56000,-1657.4020,1213.2380,20.9102,287.2069}, {"Sanchez",0,468,-1,50000,15000,750.7272,-1358.0,13.1,270.0}, {"PCJ-600",0,461,-1,1500000,28000,755.6765,-1358.0,13.1,270.0}, {"Freeway",0,463,-1,250000,18000,744.2816,-1358.0,13.1,270.0}, {"Mower",2,572,-1,100000000,100000,2145.7375,1399.1079,10.3926,180.1}, {"Quad",2,471,-1,15000000,100000,2139.0044,1398.7233,10.2785,180.1}, {"Kart",2,571,-1,10000000,100000,2132.9026,1398.6613,10.1022,180.1}, {"Caddy",2,457,-1,45000000,100000,2126.3518,1398.6478,10.4298,180.1}, {"Camper",2,483,-1,20000000,100000,2151.6248,1398.0774,10.8088,180.1}, {"Hotknife",2,434,-1,21000000,100000,2126.3159,1407.8312,10.7936,0.1}, {"BF Injection",2,424,-1,15000000,100000,2120.1184,1408.3947,10.5944,0.1}, {"Bandito",2,568,-1,26000,2050,219.8989,1399.2928,10.6762,180.1}, {"Mountain Bike",2,510,-1,1000000,100000,2132.8442,1408.3944,11.2474,0.1}, {"Vortex",2,539,-1,60000000,100000,2139.0022,1408.6088,10.8161,0.1}, {"Hotring A",2,502,-1,50000000,100000,2145.6438,1409.0603,10.7136,0.1}, {"Sandking",2,495,-1,20000000,100000,2151.8958,1407.6707,11.1689,0.1}, {"Perenniel",3,404,-1,190000,6000,1767.8556,-1690.9355,13.1595,208.9280}, {"Manana",3,410,-1,260000,8000,1771.8871,-1690.4110,13.0797,208.9280}, {"Bobcat",3,422,-1,200000,13000,1776.1863,-1690.1582,13.4179,208.9280}, {"Sabre",3,475,-1,180000,5000,1780.3630,-1690.1617,13.2405,208.9280}, {"Majestic",3,517,-1,300000,10000,1784.6860,-1690.9323,13.3005,208.9280}, {"Tampa",3,549,-1,5000,2000,1788.7902,-1690.3807,13.1542,208.9280}, {"Wayfarer",3,586,-1,400000,10000,1792.3208,-1690.6400,12.9948,208.9280}, {"Regina",3,479,-1,350000,13000,1794.9778,-1690.9299,13.0686,208.9280}, {"Comet",3,480,-1,750000,18500,1798.2477,-1690.0856,13.2728,208.9280}, {"Flash",0,565,-1,1000000,21000,771.0,-1333.0,13.3,211.1}, {"Pony",4,413,-1,21000,3460,-2492.2500,1214.0000,37.5366,142.0000}, {"Hermes",4,474,-1,29000,2104,-2495.2500,1216.5000,37.1260,142.0000}, {"Virgo",4,491,-1,17000,2161,-2498.0000,1219.0000,37.1073,142.0000}, {"Tahoma",4,566,-1,23000,2180,-2502.0000,1222.0000,37.2277,142.0000}, {"Yosemite",4,554,-1,21000,3154,-2512.0000,1209.2500,37.4300,270.0000}, {"Hermes",4,474,-1,21000,1153,-2512.0000,1205.2500,37.1608,270.0000}, {"Emperor",4,585,-1,26000,3150,-2517.0000,1229.0000,36.9389,211.0000}, {"Solair",4,458,-1,25000,2182,-2521.0000,1229.0000,37.3360,211.0000}, {"Rancher",4,489,-1,30000,2122,-2526.0000,1229.0000,37.5171,211.0000}, {"Greenwood",4,492,-1,24000,1102,-2530.0000,1229.0000,37.1436,211.0000}, {"Benson",4,499,-1,100000,2000,741.8998,-1334.9238,13.5294,212.4395}, {"Fortune",4,526,-1,44000,3400,-2538.5000,1229.0000,37.1314,211.0000}, {"Maverick",5,487,-1,30000000,100000,2103.1494,1437.4559,10.8203,211.0000}, {"Stallion",6,439,-1,30000,3000,2136.0498,-1139.7673,25.2635,28.0000}, {"Buccaneer",7,518,-1,20000,2000,2134.9370,-1145.3979,24.5874,28.0000}, {"Limousine",5,409,-1,45000000,100000,2117.7676,1399.5448,10.6163,90.2126}, {"NRG-500",2,522,-1,20000000, 100000,2113.5930,1407.9160,10.3899,0.2636} };
-
Ändere das
Name[128],
mal zu
Name[16],Wen das nicht geht, füge zudem unter den Includes mal das ein:
#pragma dynamic 1000000 -
Führt nichts davon zur Problembehebung, Ich spawn zwar weil wir ja den public über ein Timer aufrufen aber laden tut mein Auto nicht.
Hier nochmal paar publics:C
Alles anzeigenif(strcmp("/buycar", cmd, true) == 0) { if(Spectating[playerid] != -1) { if(Carlist[playerid][CarKey[playerid]][Typ] == -1) { new preis = Kaufliste[Spectating[playerid]][Preis]; new autohaus = Kaufliste[Spectating[playerid]][Autohaus]; if(PlayerInfo[playerid][pKreditkarte] == 1 && PlayerInfo[playerid][pKreditkartebenutzen] == 1) { if(PlayerInfo[playerid][pBank] >= preis) { PlayerInfo[playerid][pBank] -= preis; SendClientMessage(playerid,COLOR_YELLOW,"Du hast erfolgreich mit deiner Kreditkarte bezahlt, der Betrag wurde von deinem Konto abgebucht."); } else { SendClientMessage(playerid,COLOR_ERRORTEXT,"Du hast nicht genug Geld auf deinem Konto."); return 1; } } else { if(preis <= PlayerInfo[playerid][pCash]) { GivePlayerMoneys(playerid, - preis); } else { SendClientMessage(playerid,COLOR_ERRORTEXT,"Du hast nicht genug Geld auf der Hand!"); return 1; } } Carlist[playerid][CarKey[playerid]][Typ] = Spectating[playerid]; Carlist[playerid][CarKey[playerid]][pos_x] = Autospawns[autohaus][pos_x]; Carlist[playerid][CarKey[playerid]][pos_y] = Autospawns[autohaus][pos_y]; Carlist[playerid][CarKey[playerid]][pos_z] = Autospawns[autohaus][pos_z]; Carlist[playerid][CarKey[playerid]][z_angle] = Autospawns[autohaus][z_angle]; Carlist[playerid][CarKey[playerid]][SpawnSaveX] = Autospawns[autohaus][pos_x]; Carlist[playerid][CarKey[playerid]][SpawnSaveY] = Autospawns[autohaus][pos_y]; Carlist[playerid][CarKey[playerid]][SpawnSaveZ] = Autospawns[autohaus][pos_z]; Carlist[playerid][CarKey[playerid]][SpawnSaveRot] = Autospawns[autohaus][z_angle]; Carlist[playerid][CarKey[playerid]][Status] = 0; Carlist[playerid][CarKey[playerid]][Lock] = 0; Carlist[playerid][CarKey[playerid]][TankVolumen] = 100; Carlist[playerid][CarKey[playerid]][Carid] = CreateTunedCar(playerid, CarKey[playerid]); Carlist[playerid][CarKey[playerid]][Meter] = 0; Gas[Carlist[playerid][CarKey[playerid]][Carid]] = Carlist[playerid][CarKey[playerid]][TankVolumen]; createcarupdate(playerid,CarKey[playerid],PlayerInfo[playerid][pSQLID]); SetPlayerCheckpoint(playerid,Carlist[playerid][CarKey[playerid]][pos_x],Carlist[playerid][CarKey[playerid]][pos_y],Carlist[playerid][CarKey[playerid]][pos_z],10.0); ForAllPlayers(i){ if(IsPlayerConnected(i)){ SetVehicleParamsForPlayer(Kaufliste[Spectating[playerid]][Carid], i, 0, 0); }} TogglePlayerControllable(playerid,1); RemovePlayerFromVehicle(playerid); format(string, sizeof(string), "Du hast dir erfolgreich für %s$ ein/einen %s gekauft!",GetPoint(preis),Kaufliste[Carlist[playerid][CarKey[playerid]][Typ]][Name]); SendClientMessage(playerid, COLOR_RED, string); SendClientMessage(playerid, COLOR_GREEN, "Wenn du dein Fahrzeug zerstörst, gib /fixcar ein."); SendClientMessage(playerid, COLOR_GREEN, "Mit /carlock kannst du dein Fahrzeug für andere Leute freigeben oder abschließen."); SendClientMessage(playerid, COLOR_GREEN, "Mehr Befehle kannst du unter /carhelp sehen."); SendClientMessage(playerid, COLOR_YELLOW, "Dein Auto steht am Ausgabepunkt(Roter Marker) bereit! Viel Spaß beim Fahren!"); if(Kaufliste[Spectating[playerid]][Autohaus] == 2) { BizInfo[14][bTill] += (preis/100)*19; } Spectating[playerid] = -1; } else { SendClientMessage(playerid, COLOR_ERRORTEXT, " Du besitzt bereits ein Auto auf dem ausgewählten Schlüssel!"); } } else { SendClientMessage(playerid, COLOR_ERRORTEXT, " Du besichtigst kein Auto !"); } return 1; } public PlayerCarConnect(playerid) { printf("Starte PlayerCarConnect für %d (MySQL = %d)", playerid, SaveServerMySQL); if(IsPlayerNPC(playerid)) { printf("NPC"); return 1; } new string[128], playername[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername, sizeof(playername)); for(new h = 0; h < MaxVeh[playerid]; h++) { printf("h: %d", h); if(SaveServerMySQL==0) { format(string, sizeof(string), "cars/%dAutoNR%d.ini", PlayerInfo[playerid][pSQLID], h); if(fexist(string)) { new data[256]; data = dini_Get(string,"AH_Typ"); Carlist[playerid][h][Typ] = strval( data ); data = dini_Get(string,"AH_X"); Carlist[playerid][h][pos_x] = floatstr( data ); data = dini_Get(string,"AH_Y"); Carlist[playerid][h][pos_y] = floatstr( data ); data = dini_Get(string,"AH_Z"); Carlist[playerid][h][pos_z] = floatstr( data ); data = dini_Get(string,"AH_Rot"); Carlist[playerid][h][z_angle] = floatstr( data ); data = dini_Get(string,"AH_Status"); Carlist[playerid][h][Status] = strval( data ); data = dini_Get(string,"AH_Lock"); Carlist[playerid][h][Lock] = strval( data ); data = dini_Get(string,"AH_Paintjob"); Carlist[playerid][h][Paintjob] = strval( data ); data = dini_Get(string,"AH_Farbe1"); Carlist[playerid][h][Farbe1] = strval( data ); data = dini_Get(string,"AH_Farbe2"); Carlist[playerid][h][Farbe2] = strval( data ); data = dini_Get(string,"AH_mod1"); Carlist[playerid][h][mod1] = strval( data ); data = dini_Get(string,"AH_mod2"); Carlist[playerid][h][mod2] = strval( data ); data = dini_Get(string,"AH_mod3"); Carlist[playerid][h][mod3] = strval( data ); data = dini_Get(string,"AH_mod4"); Carlist[playerid][h][mod4] = strval( data ); data = dini_Get(string,"AH_mod5"); Carlist[playerid][h][mod5] = strval( data ); data = dini_Get(string,"AH_mod6"); Carlist[playerid][h][mod6] = strval( data ); data = dini_Get(string,"AH_mod7"); Carlist[playerid][h][mod7] = strval( data ); data = dini_Get(string,"AH_mod8"); Carlist[playerid][h][mod8] = strval( data ); data = dini_Get(string,"AH_mod9"); Carlist[playerid][h][mod9] = strval( data ); data = dini_Get(string,"AH_mod10"); Carlist[playerid][h][mod10] = strval( data ); data = dini_Get(string,"AH_mod11"); Carlist[playerid][h][mod11] = strval( data ); data = dini_Get(string,"AH_mod12"); Carlist[playerid][h][mod12] = strval( data ); data = dini_Get(string,"AH_mod13"); Carlist[playerid][h][mod13] = strval( data ); data = dini_Get(string,"AH_mod14"); Carlist[playerid][h][mod14] = strval( data ); data = dini_Get(string,"AH_mod15"); Carlist[playerid][h][mod15] = strval( data ); data = dini_Get(string,"AH_mod16"); Carlist[playerid][h][mod16] = strval( data ); data = dini_Get(string,"AH_mod17"); Carlist[playerid][h][mod17] = strval( data ); data = dini_Get(string,"AH_SpawnSaveX"); Carlist[playerid][h][SpawnSaveX] = floatstr( data ); data = dini_Get(string,"AH_SpawnSaveY"); Carlist[playerid][h][SpawnSaveY] = floatstr( data ); data = dini_Get(string,"AH_SpawnSaveZ"); Carlist[playerid][h][SpawnSaveZ] = floatstr( data ); data = dini_Get(string,"AH_SpawnSaveRot"); Carlist[playerid][h][SpawnSaveRot] = floatstr( data ); data = dini_Get(string,"AH_TankVolumen"); Carlist[playerid][h][TankVolumen] = strval( data ); data = dini_Get(string,"AH_RepairTime"); Carlist[playerid][h][RepairTime] = strval(data); data = dini_Get(string,"AH_Versicherung"); Carlist[playerid][h][Versicherung] = strval(data); data = dini_Get(string,"AH_StandTime"); Carlist[playerid][h][StandTime] = strval(data); data = dini_Get(string,"AH_Meter"); Carlist[playerid][h][Meter] = strval(data); } } else { format(string, sizeof(string),"SELECT * FROM `usercars` WHERE `Name` = '%dAutoNR%d'",PlayerInfo[playerid][pSQLID], h); printf("string = %s", string); self_mysql_queryEx(string); mysql_store_result(MySQLConnection); printf("rows: %d", mysql_num_rows(MySQLConnection)); if(mysql_num_rows(MySQLConnection) != 0) { printf("Starte Laden der Daten..."); mysql_fetch_row_format(string); new val[ 256 ]; self_mysql_get_field("AH_Typ", val); Carlist[playerid][h][Typ] = strval( val ); self_mysql_get_field("AH_X", val); Carlist[playerid][h][pos_x] = floatstr( val ); self_mysql_get_field("AH_Y", val); Carlist[playerid][h][pos_y] = floatstr( val ); self_mysql_get_field("AH_Z", val); Carlist[playerid][h][pos_z] = floatstr( val ); self_mysql_get_field("AH_Rot", val); Carlist[playerid][h][z_angle] = floatstr( val ); self_mysql_get_field("AH_Status", val); Carlist[playerid][h][Status] = strval( val ); self_mysql_get_field("AH_Lock", val); Carlist[playerid][h][Lock] = strval( val ); self_mysql_get_field("AH_Paintjob", val); Carlist[playerid][h][Paintjob] = strval( val ); self_mysql_get_field("AH_Farbe1", val); Carlist[playerid][h][Farbe1] = strval( val ); self_mysql_get_field("AH_Farbe2", val); Carlist[playerid][h][Farbe2] = strval( val ); self_mysql_get_field("AH_mod1", val); Carlist[playerid][h][mod1] = strval( val ); self_mysql_get_field("AH_mod2", val); Carlist[playerid][h][mod2] = strval( val ); self_mysql_get_field("AH_mod3", val); Carlist[playerid][h][mod3] = strval( val ); self_mysql_get_field("AH_mod4", val); Carlist[playerid][h][mod4] = strval( val ); self_mysql_get_field("AH_mod5", val); Carlist[playerid][h][mod5] = strval( val ); self_mysql_get_field("AH_mod6", val); Carlist[playerid][h][mod6] = strval( val ); self_mysql_get_field("AH_mod7", val); Carlist[playerid][h][mod7] = strval( val ); self_mysql_get_field("AH_mod8", val); Carlist[playerid][h][mod8] = strval( val ); self_mysql_get_field("AH_mod9", val); Carlist[playerid][h][mod9] = strval( val ); self_mysql_get_field("AH_mod10", val); Carlist[playerid][h][mod10] = strval( val ); self_mysql_get_field("AH_mod11", val); Carlist[playerid][h][mod11] = strval( val ); self_mysql_get_field("AH_mod12", val); Carlist[playerid][h][mod12] = strval( val ); self_mysql_get_field("AH_mod13", val); Carlist[playerid][h][mod13] = strval( val ); self_mysql_get_field("AH_mod14", val); Carlist[playerid][h][mod14] = strval( val ); self_mysql_get_field("AH_mod15", val); Carlist[playerid][h][mod15] = strval( val ); self_mysql_get_field("AH_mod16", val); Carlist[playerid][h][mod16] = strval( val ); self_mysql_get_field("AH_mod17", val); Carlist[playerid][h][mod17] = strval( val ); self_mysql_get_field("AH_SpawnSaveX", val); Carlist[playerid][h][SpawnSaveX] = floatstr( val ); self_mysql_get_field("AH_SpawnSaveY", val); Carlist[playerid][h][SpawnSaveY] = floatstr( val ); self_mysql_get_field("AH_SpawnSaveZ", val); Carlist[playerid][h][SpawnSaveZ] = floatstr( val ); self_mysql_get_field("AH_SpawnSaveRot", val); Carlist[playerid][h][SpawnSaveRot] = floatstr( val ); self_mysql_get_field("AH_TankVolumen", val); Carlist[playerid][h][TankVolumen] = strval( val ); self_mysql_get_field("AH_RepairTime", val); Carlist[playerid][h][RepairTime] = strval( val ); self_mysql_get_field("AH_Versicherung", val); Carlist[playerid][h][Versicherung] = strval( val ); self_mysql_get_field("AH_StandTime", val); Carlist[playerid][h][StandTime] = strval( val ); self_mysql_get_field("AH_Meter", val); Carlist[playerid][h][Meter] = strval( val ); printf("Laden der Daten beendet."); } mysql_free_result(MySQLConnection); printf("Result frei."); } if(Carlist[playerid][h][Typ] != -1 && Carlist[playerid][h][Status] == 0) { printf("Fahrzeugspeicherung: Beginning Spawn."); Carlist[playerid][h][Carid] = CreateTunedCar(playerid, h); printf("Fahrzeugspeicherung: End Spawn (%d).", Carlist[playerid][h][Carid]); } printf("Durch."); } printf("Alle Fahrzeuge wurden erfolgreich geladen. Beende Funktion."); return 1; } forward createcarupdate(playerid,chid,psqqlid); public createcarupdate(playerid,chid,psqqlid) { new var[2000],formi[50],formi2[200],formi3[200],formi4[200],formi5[200]; format(formi2,200,"`AH_SpawnSaveX`, `AH_SpawnSaveY`, `AH_SpawnSaveZ`, `AH_SpawnSaveRot`, `AH_TankVolumen`, `AH_RepairTime`, `AH_Versicherung`, `AH_StandTime`, `AH_Meter`"); format(formi3,200,"`AH_mod5`, `AH_mod6`, `AH_mod7`, `AH_mod8`, `AH_mod9`, `AH_mod10`, `AH_mod11`, `AH_mod12`, `AH_mod13`, `AH_mod14`, `AH_mod15`, `AH_mod16`, `AH_mod17`"); format(formi4,200,"'%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d'", Carlist[playerid][chid][mod5],Carlist[playerid][chid][mod6],Carlist[playerid][chid][mod7],Carlist[playerid][chid][mod8],Carlist[playerid][chid][mod9],Carlist[playerid][chid][mod10],Carlist[playerid][chid][mod11],Carlist[playerid][chid][mod12],Carlist[playerid][chid][mod13], Carlist[playerid][chid][mod14],Carlist[playerid][chid][mod15],Carlist[playerid][chid][mod16],Carlist[playerid][chid][mod17]); format(formi5,200,"'%.1f', '%.1f', '%.1f', '%.1f', '%d', '%d', '%d', '%d', '%d'", Carlist[playerid][chid][SpawnSaveX],Carlist[playerid][chid][SpawnSaveY],Carlist[playerid][chid][SpawnSaveZ],Carlist[playerid][chid][SpawnSaveRot], Carlist[playerid][chid][TankVolumen],Carlist[playerid][chid][RepairTime],Carlist[playerid][chid][Versicherung],Carlist[playerid][chid][StandTime],Carlist[playerid][chid][Meter]); format(formi,50,"%iAutoNR%i",psqqlid,chid); format(var, sizeof(var), "INSERT INTO `usercars` (`Name`, `AH_Typ`, `AH_X`, `AH_Y`, `AH_Z`, `AH_Rot`, `AH_Status`, `AH_Lock`, `AH_Paintjob`, `AH_Farbe1`, `AH_Farbe2`, `AH_mod1`, `AH_mod2`, `AH_mod3`, `AH_mod4`, %s, %s) VALUES ('%s', '%d', '%.1f', '%.1f', '%.1f', '%.1f', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', %s, %s)", formi3,formi2,formi,Carlist[playerid][chid][Typ],Carlist[playerid][chid][pos_x],Carlist[playerid][chid][pos_y],Carlist[playerid][chid][pos_z],Carlist[playerid][chid][z_angle],Carlist[playerid][chid][Status],Carlist[playerid][chid][Lock],Carlist[playerid][chid][Paintjob], Carlist[playerid][chid][Farbe1],Carlist[playerid][chid][Farbe2],Carlist[playerid][chid][mod1],Carlist[playerid][chid][mod2],Carlist[playerid][chid][mod3],Carlist[playerid][chid][mod4],formi4,formi5); self_mysql_queryEx(var); } public PlayerCarUpdate(playerid) { if(IsPlayerNPC(playerid)) { return 1; } new string[256], playername[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername, sizeof(playername)); for(new h = 0; h < MaxVeh[playerid]; h++) { if(SaveServerMySQL==0) { format(string, sizeof(string), "cars/%dAutoNR%d.ini", PlayerInfo[playerid][pSQLID], h); new File: CarFile = fopen(string, io_write); if (CarFile) { new var[256]; format(var, 256, "AH_Typ=%d\n", Carlist[playerid][h][Typ]); fwrite(CarFile, var); format(var, 256, "AH_X=%.1f\n", Carlist[playerid][h][pos_x]); fwrite(CarFile, var); format(var, 256, "AH_Y=%.1f\n", Carlist[playerid][h][pos_y]); fwrite(CarFile, var); format(var, 256, "AH_Z=%.1f\n", Carlist[playerid][h][pos_z]); fwrite(CarFile, var); format(var, 256, "AH_Rot=%.1f\n", Carlist[playerid][h][z_angle]); fwrite(CarFile, var); format(var, 256, "AH_Status=%d\n", Carlist[playerid][h][Status]); fwrite(CarFile, var); format(var, 256, "AH_Lock=%d\n", Carlist[playerid][h][Lock]); fwrite(CarFile, var); format(var, 256, "AH_Paintjob=%d\n", Carlist[playerid][h][Paintjob]); fwrite(CarFile, var); format(var, 256, "AH_Farbe1=%d\n", Carlist[playerid][h][Farbe1]); fwrite(CarFile, var); format(var, 256, "AH_Farbe2=%d\n", Carlist[playerid][h][Farbe2]); fwrite(CarFile, var); format(var, 256, "AH_mod1=%d\n", Carlist[playerid][h][mod1]); fwrite(CarFile, var); format(var, 256, "AH_mod2=%d\n", Carlist[playerid][h][mod2]); fwrite(CarFile, var); format(var, 256, "AH_mod3=%d\n", Carlist[playerid][h][mod3]); fwrite(CarFile, var); format(var, 256, "AH_mod4=%d\n", Carlist[playerid][h][mod4]); fwrite(CarFile, var); format(var, 256, "AH_mod5=%d\n", Carlist[playerid][h][mod5]); fwrite(CarFile, var); format(var, 256, "AH_mod6=%d\n", Carlist[playerid][h][mod6]); fwrite(CarFile, var); format(var, 256, "AH_mod7=%d\n", Carlist[playerid][h][mod7]); fwrite(CarFile, var); format(var, 256, "AH_mod8=%d\n", Carlist[playerid][h][mod8]); fwrite(CarFile, var); format(var, 256, "AH_mod9=%d\n", Carlist[playerid][h][mod9]); fwrite(CarFile, var); format(var, 256, "AH_mod10=%d\n", Carlist[playerid][h][mod10]); fwrite(CarFile, var); format(var, 256, "AH_mod11=%d\n", Carlist[playerid][h][mod11]); fwrite(CarFile, var); format(var, 256, "AH_mod12=%d\n", Carlist[playerid][h][mod12]); fwrite(CarFile, var); format(var, 256, "AH_mod13=%d\n", Carlist[playerid][h][mod13]); fwrite(CarFile, var); format(var, 256, "AH_mod14=%d\n", Carlist[playerid][h][mod14]); fwrite(CarFile, var); format(var, 256, "AH_mod15=%d\n", Carlist[playerid][h][mod15]); fwrite(CarFile, var); format(var, 256, "AH_mod16=%d\n", Carlist[playerid][h][mod16]); fwrite(CarFile, var); format(var, 256, "AH_mod17=%d\n", Carlist[playerid][h][mod17]); fwrite(CarFile, var); format(var, 256, "AH_SpawnSaveX=%.1f\n", Carlist[playerid][h][SpawnSaveX]); fwrite(CarFile, var); format(var, 256, "AH_SpawnSaveY=%.1f\n", Carlist[playerid][h][SpawnSaveY]); fwrite(CarFile, var); format(var, 256, "AH_SpawnSaveZ=%.1f\n", Carlist[playerid][h][SpawnSaveZ]); fwrite(CarFile, var); format(var, 256, "AH_SpawnSaveRot=%.1f\n", Carlist[playerid][h][SpawnSaveRot]); fwrite(CarFile, var); format(var, 256, "AH_TankVolumen=%d\n", Carlist[playerid][h][TankVolumen]); fwrite(CarFile, var); format(var, 256, "AH_RepairTime=%d\n", Carlist[playerid][h][RepairTime]); fwrite(CarFile, var); format(var, 256, "AH_Versicherung=%d\n", Carlist[playerid][h][Versicherung]); fwrite(CarFile, var); format(var, 256, "AH_StandTime=%d\n", Carlist[playerid][h][StandTime]); fwrite(CarFile, var); format(var, 256, "AH_Meter=%d\n", Carlist[playerid][h][Meter]); fwrite(CarFile, var); fclose(CarFile); } } else { if(Carlist[playerid][h][Typ]>=1) { new var[1000]; format(var, sizeof(var), "UPDATE `usercars` SET `AH_Typ`='%d', `AH_X`='%.1f', `AH_Y`='%.1f', `AH_Z`='%.1f', `AH_Rot`='%.1f', `AH_Status`='%d', `AH_Lock`='%d', `AH_Paintjob`='%d', `AH_Farbe1`='%d', `AH_Farbe2`='%d', `AH_mod1`='%d', `AH_mod2`='%d', `AH_mod3`='%d', `AH_mod4`='%d' WHERE `Name`='%dAutoNR%d'", Carlist[playerid][h][Typ],Carlist[playerid][h][pos_x],Carlist[playerid][h][pos_y],Carlist[playerid][h][pos_z],Carlist[playerid][h][z_angle],Carlist[playerid][h][Status],Carlist[playerid][h][Lock],Carlist[playerid][h][Paintjob], Carlist[playerid][h][Farbe1],Carlist[playerid][h][Farbe2],Carlist[playerid][h][mod1],Carlist[playerid][h][mod2],Carlist[playerid][h][mod3],Carlist[playerid][h][mod4],PlayerInfo[playerid][pSQLID],h); self_mysql_queryEx(var); format(var, sizeof(var), "UPDATE `usercars` SET `AH_mod5`='%d', AH_mod6`='%d', AH_mod7`='%d', `AH_mod8`='%d', `AH_mod9`='%d', `AH_mod10`='%d', `AH_mod11`='%d', `AH_mod12`='%d', `AH_mod13`='%d', `AH_mod14`='%d', `AH_mod15`='%d', `AH_mod16`='%d', `AH_mod17`='%d' WHERE `Name`='%dAutoNR%d'", Carlist[playerid][h][mod5],Carlist[playerid][h][mod6], Carlist[playerid][h][mod7],Carlist[playerid][h][mod8],Carlist[playerid][h][mod9],Carlist[playerid][h][mod10],Carlist[playerid][h][mod11],Carlist[playerid][h][mod12],Carlist[playerid][h][mod13], Carlist[playerid][h][mod14],Carlist[playerid][h][mod15],Carlist[playerid][h][mod16],Carlist[playerid][h][mod17],PlayerInfo[playerid][pSQLID],h); self_mysql_queryEx(var); format(var, sizeof(var), "UPDATE `usercars` SET `AH_SpawnSaveX`='%.1f', `AH_SpawnSaveY`='%.1f', `AH_SpawnSaveZ`='%.1f', `AH_SpawnSaveRot`='%.1f', `AH_TankVolumen`='%d', `AH_RepairTime`='%d', `AH_Versicherung`='%d', `AH_StandTime`='%d', `AH_Meter`='%d' WHERE `Name`='%dAutoNR%d'", Carlist[playerid][h][SpawnSaveX],Carlist[playerid][h][SpawnSaveY],Carlist[playerid][h][SpawnSaveZ],Carlist[playerid][h][SpawnSaveRot], Carlist[playerid][h][TankVolumen],Carlist[playerid][h][RepairTime],Carlist[playerid][h][Versicherung],Carlist[playerid][h][StandTime],Carlist[playerid][h][Meter],PlayerInfo[playerid][pSQLID], h); self_mysql_queryEx(var); } } } return 1; }
-
Funktioniert denn der /buycar Befehl so wie er soll?
-
Ja da funktioniert alles ohne Probleme
-
Ok, das ist schonmal gut.
Wenn du das hier:
printf("CreateTunedCar: Typ: %d", Carlist[playerid][CarKey1][Typ]);
if(IsPlayerConnected(playerid) && Carlist[playerid][CarKey1][Typ] != -1)
{
printf("Model: %d", Kaufliste[Carlist[playerid][CarKey1][Typ]][Modelid]);änderst zu:
printf("CreateTunedCar: Typ: %d", Carlist[playerid][CarKey1][Typ]);
printf("CreateTunedCar: Kaufliste0: %d", Kaufliste[0][Modelid]);
printf("CreateTunedCar: Kaufliste10: %d", Kaufliste[10][Modelid]);
if(IsPlayerConnected(playerid) && Carlist[playerid][CarKey1][Typ] != -1)
{
printf("Model: %d", Kaufliste[Carlist[playerid][CarKey1][Typ]][Modelid]);Was wird dann geprintet?
-
So mal ganz kurz ich habe nun bisschen ausprobiert,
Ich habe nun statt SetTimerEx("PlayerCarConnect", 100, false, "d", playerid);PlayerCarConnect(playerid);
So nun schaltet der Server 1. nicht ab und 2. kann ich mich einloggen und ich Spawne.
Nun ladet das Auto jedoch nicht steht aber in der MySQL Datenbank. -
Was wird dir denn geprintet, von dem was ich zuletzt gepostet habe? Das ist ja unabhängig davon, ob per Timer aufgerufen oder nicht (daran liegt es ja nicht, hatten wir ja ausgeschlossen).