Erledigt
Beiträge von Corvus
-
-
Guten Abend,
Mein Server chrashed immer beim Einloggen.
Der Server- und Mysql-log bringen nichts bedeutendes zu Tage.
Danke im vorraus.
Mfg, Daniel -
Wie sieht der Befehl /buycar jetzt aus?
Was steht im server_log.txt wenn du den Befehl eingibst (es sind ja, zumindest in dem Post oben, bereits Debugmeldungen vorhanden)?
Buycar befehl:if(strcmp("/buycar", cmd, true) == 0)
{
if(Spectating[playerid] != -1)
{
if(Carlist[playerid][CarKey[playerid]][Typ] == -1)
{
new preis = Kaufliste[Spectating[playerid]][Preis];
if(preis <= PlayerInfo[playerid][pCash])
{
new autohaus = Kaufliste[Spectating[playerid]][Autohaus];
print("OnPlayerDeath: message sent");
GivePlayerMoneys(playerid, - preis);
print("OnPlayerDeath: message sent1");
Carlist[playerid][CarKey[playerid]][Typ] = GetVehicleModel(GetPlayerVehicleID(playerid));
printf("%i",Spectating[playerid]);
Carlist[playerid][CarKey[playerid]][pos_x] = Autospawns[autohaus][pos_x];
print("OnPlayerDeath: message sent3");
Carlist[playerid][CarKey[playerid]][pos_y] = Autospawns[autohaus][pos_y];
Carlist[playerid][CarKey[playerid]][pos_z] = Autospawns[autohaus][pos_z];
print("OnPlayerDeath: message sent4");
Carlist[playerid][CarKey[playerid]][z_angle] = Autospawns[autohaus][z_angle];
print("OnPlayerDeath: message sent5");
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];
print("OnPlayerDeath: message sent6");
Carlist[playerid][CarKey[playerid]][SpawnSaveRot] = Autospawns[autohaus][z_angle];
print("OnPlayerDeath: message sent7");
Carlist[playerid][CarKey[playerid]][Status] = 0;
print("OnPlayerDeath: message sent8");
Carlist[playerid][CarKey[playerid]][Lock] = 0;
Carlist[playerid][CarKey[playerid]][TankVolumen] = 100;
print("OnPlayerDeath: message sent9");
Carlist[playerid][CarKey[playerid]][Carid] = CreateTunedCar(playerid, CarKey[playerid]);
print("OnPlayerDeath: message sent10");
Carlist[playerid][CarKey[playerid]][Meter] = 0;
Gas[Carlist[playerid][CarKey[playerid]][Carid]] = Carlist[playerid][CarKey[playerid]][TankVolumen];
print("OnPlayerDeath: message sent11");
SetPlayerCheckpoint(playerid,Carlist[playerid][CarKey[playerid]][pos_x],Carlist[playerid][CarKey[playerid]][pos_y],Carlist[playerid][CarKey[playerid]][pos_z],10.0);
print("OnPlayerDeath: message sent12");
new query[900], h = CarKey[playerid];
format(query,sizeof(query),"INSERT INTO `cars` (`sqlid`,`carkey`,`ingarage`,`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`,`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(query,sizeof(query),"%s`AH_SpawnSaveX`,`AH_SpawnSaveY`,`AH_SpawnSaveZ`,`AH_SpawnSaveRot`,`AH_TankVolumen`,`AH_Mats`,`AH_Neon`,`AH_NeonType`,`AH_Drugs`,`AH_StandTime`,`AH_Meter`) VALUES (%d,%d,%i,%i,%f,%f,%f,%f,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%f,%f,%f,%f,%i,%i,%i,%i,%i,%i,%i)",
query,PlayerInfo[playerid][pSQLID],h,Carlist[playerid][h][ingarage],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],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],
Carlist[playerid][h][SpawnSaveX],Carlist[playerid][h][SpawnSaveY],Carlist[playerid][h][SpawnSaveZ],
Carlist[playerid][h][SpawnSaveRot],Carlist[playerid][h][TankVolumen],Carlist[playerid][h][cMats],
Carlist[playerid][h][Neon],Carlist[playerid][h][NeonType],Carlist[playerid][h][cDrugs],Carlist[playerid][h][StandTime],
Carlist[playerid][h][Meter]);
mysql_query(query);
ForAllPlayers(i){
if(IsPlayerConnected(i)){
SetVehicleParamsForPlayer(Kaufliste[Spectating[playerid]][Carid], i, 0, 0);
print("OnPlayerDeath: message sent13");
}}
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_LIGHTBLUE, "öffnen und Schließen kannst du es mit /lock und /carlock.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Mehr Befehle kannst du unter /carhelp sehen.");
SendClientMessage(playerid, COLOR_YELLOW, "Dein Auto steht am Ausgabepunkt(Roter Marker) bereit! Viel Spaß beim Fahren!");
GetPlayerName(playerid, sendername, sizeof(sendername));
if(Kaufliste[Spectating[playerid]][Autohaus] == 2)
{
BizInfo[13][bTill] += (preis/100)*19;
}
Spectating[playerid] = -1;
}
else
{
format(string, sizeof(string), " Du hast nicht genug Geld für das Auto (benötigt: $%i)!", preis);
SendClientMessage(playerid, COLOR_ERRORTEXT, string);
}
}
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;
}
[15:16:19] OnPlayerDeath: message sent
[15:16:19] OnPlayerDeath: message sent1
[15:16:19] 10
[15:16:19] OnPlayerDeath: message sent3
[15:16:19] OnPlayerDeath: message sent4
[15:16:19] OnPlayerDeath: message sent5
[15:16:19] OnPlayerDeath: message sent6
[15:16:19] OnPlayerDeath: message sent7
[15:16:19] OnPlayerDeath: message sent8
[15:16:19] OnPlayerDeath: message sent9
[15:16:19] ingarage=0
[15:16:19] ingarage=0 -
Was heißt der AH_Typ wird nicht richtig eingetragen? Was sollte drin stehen, und was steht drin?
Was sagt der MySQL Log?
Nun kommt "Unknown Server Command beim Kauf des Cars. Davor wurde der Wert nicht richtig eingetragen.
Im Mysql Log stimmt inzwischen alles. -
public PlayerCarUpdate(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
new string[2048], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
for(new h = 0; h < MaxVeh[playerid]; h++)
{
format(string, sizeof(string), "UPDATE `cars` SET `ingarage`=%i,`AH_Typ`=%i,`AH_X`='%f',`AH_Y`='%f',`AH_Z`='%f',`AH_Rot`='%f',`AH_Status`=%i,`AH_Lock`=%i,`AH_Paintjob`=%i,`Farbe1`=%i,`Farbe2`=%i,`AH_mod1`=%i,`AH_mod2`=%i,`AH_mod3`=%i,`AH_mod4`=%i,`AH_mod5`=%i,`AH_mod6`=%i,`AH_mod7`=%i,`AH_mod8`=%i,`AH_mod9`=%i,`AH_mod10`=%i,`AH_mod11`=%i,`AH_mod12`=%i,`AH_mod13`=%i,`AH_mod14`=%i,`AH_mod15`=%i,`AH_mod16`=%i,`AH_mod17`=%i,",
Carlist[playerid][h][ingarage],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],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]);format(string, sizeof(string),"%s`AH_SpawnSaveX`=%f,`AH_SpawnSaveY`='%f',`AH_SpawnSaveZ`='%f',`AH_SpawnSaveRot`='%f',`AH_TankVolumen`=%i,`AH_Mats`=%i,`AH_Neon`=%i,`AH_NeonType`=%i,`AH_Drugs`=%i,`AH_StandTime`=%i,`AH_Meter`=%i WHERE `sqlid`=%i AND `carkey`=%i",
string, Carlist[playerid][h][SpawnSaveX],Carlist[playerid][h][SpawnSaveY],Carlist[playerid][h][SpawnSaveZ],
Carlist[playerid][h][SpawnSaveRot],Carlist[playerid][h][TankVolumen],Carlist[playerid][h][cMats],
Carlist[playerid][h][Neon],Carlist[playerid][h][NeonType],Carlist[playerid][h][cDrugs],Carlist[playerid][h][StandTime],
Carlist[playerid][h][Meter],PlayerInfo[playerid][pSQLID],h);self_mysql_query(string);
}
return 1;
}So, hab die Versicherung rausgenommen.
Jetzt wird alles richtig eingestragen auser Ah_Typif(strcmp("/buycar", cmd, true) == 0)
{
if(Spectating[playerid] != -1)
{
if(Carlist[playerid][CarKey[playerid]][Typ] == -1)
{
new preis = Kaufliste[Spectating[playerid]][Preis];
if(preis <= PlayerInfo[playerid][pCash])
{
new autohaus = Kaufliste[Spectating[playerid]][Autohaus];
print("OnPlayerDeath: message sent");
GivePlayerMoneys(playerid, - preis);
print("OnPlayerDeath: message sent1");
Carlist[playerid][CarKey[playerid]][Typ] = GetVehicleModel(GetPlayerVehicleID(playerid));
printf("%i",Spectating[playerid]);
Carlist[playerid][CarKey[playerid]][pos_x] = Autospawns[autohaus][pos_x];
print("OnPlayerDeath: message sent3");
Carlist[playerid][CarKey[playerid]][pos_y] = Autospawns[autohaus][pos_y];
Carlist[playerid][CarKey[playerid]][pos_z] = Autospawns[autohaus][pos_z];
print("OnPlayerDeath: message sent4");
Carlist[playerid][CarKey[playerid]][z_angle] = Autospawns[autohaus][z_angle];
print("OnPlayerDeath: message sent5");
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];
print("OnPlayerDeath: message sent6");
Carlist[playerid][CarKey[playerid]][SpawnSaveRot] = Autospawns[autohaus][z_angle];
print("OnPlayerDeath: message sent7");
Carlist[playerid][CarKey[playerid]][Status] = 0;
print("OnPlayerDeath: message sent8");
Carlist[playerid][CarKey[playerid]][Lock] = 0;
Carlist[playerid][CarKey[playerid]][TankVolumen] = 100;
print("OnPlayerDeath: message sent9");
Carlist[playerid][CarKey[playerid]][Carid] = CreateTunedCar(playerid, CarKey[playerid]);
print("OnPlayerDeath: message sent10");
Carlist[playerid][CarKey[playerid]][Meter] = 0;
Gas[Carlist[playerid][CarKey[playerid]][Carid]] = Carlist[playerid][CarKey[playerid]][TankVolumen];
print("OnPlayerDeath: message sent11");
SetPlayerCheckpoint(playerid,Carlist[playerid][CarKey[playerid]][pos_x],Carlist[playerid][CarKey[playerid]][pos_y],Carlist[playerid][CarKey[playerid]][pos_z],10.0);
print("OnPlayerDeath: message sent12");
new query[900], h = CarKey[playerid];
format(query,sizeof(query),"INSERT INTO `cars` (`sqlid`,`carkey`,`ingarage`,`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`,`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(query,sizeof(query),"%s`AH_SpawnSaveX`,`AH_SpawnSaveY`,`AH_SpawnSaveZ`,`AH_SpawnSaveRot`,`AH_TankVolumen`,`AH_Mats`,`AH_Neon`,`AH_NeonType`,`AH_Drugs`,`AH_StandTime`,`AH_Meter`) VALUES (%d,%d,%i,%i,%f,%f,%f,%f,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%f,%f,%f,%f,%i,%i,%i,%i,%i,%i,%i)",
query,PlayerInfo[playerid][pSQLID],h,Carlist[playerid][h][ingarage],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],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],
Carlist[playerid][h][SpawnSaveX],Carlist[playerid][h][SpawnSaveY],Carlist[playerid][h][SpawnSaveZ],
Carlist[playerid][h][SpawnSaveRot],Carlist[playerid][h][TankVolumen],Carlist[playerid][h][cMats],
Carlist[playerid][h][Neon],Carlist[playerid][h][NeonType],Carlist[playerid][h][cDrugs],Carlist[playerid][h][StandTime],
Carlist[playerid][h][Meter]);
mysql_query(query);
ForAllPlayers(i){
if(IsPlayerConnected(i)){
SetVehicleParamsForPlayer(Kaufliste[Spectating[playerid]][Carid], i, 0, 0);
print("OnPlayerDeath: message sent13");
}}
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_LIGHTBLUE, "öffnen und Schließen kannst du es mit /lock und /carlock.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Mehr Befehle kannst du unter /carhelp sehen.");
SendClientMessage(playerid, COLOR_YELLOW, "Dein Auto steht am Ausgabepunkt(Roter Marker) bereit! Viel Spaß beim Fahren!");
GetPlayerName(playerid, sendername, sizeof(sendername));
if(Kaufliste[Spectating[playerid]][Autohaus] == 2)
{
BizInfo[13][bTill] += (preis/100)*19;
}
Spectating[playerid] = -1;
}
else
{
format(string, sizeof(string), " Du hast nicht genug Geld für das Auto (benötigt: $%i)!", preis);
SendClientMessage(playerid, COLOR_ERRORTEXT, string);
}
}
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)
{
if(IsPlayerNPC(playerid))
{
return 1;
}
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
for(new h = 0; h < MaxVeh[playerid]; h++)
{
new data[100],TextString[50];
format(TextString, sizeof(TextString), "SELECT * FROM `cars` WHERE `id`=%i", PlayerInfo[playerid][pSQLID]);
self_mysql_query(TextString);
mysql_store_result(MySQLConnection);
if(mysql_num_rows(MySQLConnection) != 0)
{
mysql_fetch_row_format(TextString);
self_mysql_get_field("id", data); Carlist[playerid][h][cid] = strval( data );
self_mysql_get_field("sqlid", data); Carlist[playerid][h][sqlid] = strval( data );
self_mysql_get_field("ingarage", data); Carlist[playerid][h][ingarage] = strval( data );
self_mysql_get_field("AH_Typ", data); Carlist[playerid][h][Typ] = strval( data );
self_mysql_get_field("AH_X", data); Carlist[playerid][h][pos_x] = floatstr( data );
self_mysql_get_field("AH_Y", data); Carlist[playerid][h][pos_y] = floatstr( data );
self_mysql_get_field("AH_Z", data); Carlist[playerid][h][pos_z] = floatstr( data );
self_mysql_get_field("AH_Rot", data); Carlist[playerid][h][z_angle] = floatstr( data );
self_mysql_get_field("AH_Status", data); Carlist[playerid][h][Status] = strval( data );
self_mysql_get_field("AH_Lock", data); Carlist[playerid][h][Lock] = strval( data );
self_mysql_get_field("AH_Paintjob", data); Carlist[playerid][h][Paintjob] = strval( data );
self_mysql_get_field("AH_Farbe1", data); Carlist[playerid][h][Farbe1] = strval( data );
self_mysql_get_field("AH_Farbe2", data); Carlist[playerid][h][Farbe2] = strval( data );
self_mysql_get_field("AH_mod1", data); Carlist[playerid][h][mod1] = strval( data );
self_mysql_get_field("AH_mod2", data); Carlist[playerid][h][mod2] = strval( data );
self_mysql_get_field("AH_mod3", data); Carlist[playerid][h][mod3] = strval( data );
self_mysql_get_field("AH_mod4", data); Carlist[playerid][h][mod4] = strval( data );
self_mysql_get_field("AH_mod5", data); Carlist[playerid][h][mod5] = strval( data );
self_mysql_get_field("AH_mod6", data); Carlist[playerid][h][mod6] = strval( data );
self_mysql_get_field("AH_mod7", data); Carlist[playerid][h][mod7] = strval( data );
self_mysql_get_field("AH_mod8", data); Carlist[playerid][h][mod8] = strval( data );
self_mysql_get_field("AH_mod9", data); Carlist[playerid][h][mod9] = strval( data );
self_mysql_get_field("AH_mod10", data); Carlist[playerid][h][mod10] = strval( data );
self_mysql_get_field("AH_mod11", data); Carlist[playerid][h][mod11] = strval( data );
self_mysql_get_field("AH_mod12", data); Carlist[playerid][h][mod12] = strval( data );
self_mysql_get_field("AH_mod13", data); Carlist[playerid][h][mod13] = strval( data );
self_mysql_get_field("AH_mod14", data); Carlist[playerid][h][mod14] = strval( data );
self_mysql_get_field("AH_mod15", data); Carlist[playerid][h][mod15] = strval( data );
self_mysql_get_field("AH_mod16", data); Carlist[playerid][h][mod16] = strval( data );
self_mysql_get_field("AH_mod17", data); Carlist[playerid][h][mod17] = strval( data );
self_mysql_get_field("AH_SpawnSaveX", data); Carlist[playerid][h][SpawnSaveX] = floatstr( data );
self_mysql_get_field("AH_SpawnSaveY", data); Carlist[playerid][h][SpawnSaveY] = floatstr( data );
self_mysql_get_field("AH_SpawnSaveZ", data); Carlist[playerid][h][SpawnSaveZ] = floatstr( data );
self_mysql_get_field("AH_SpawnSaveRot", data); Carlist[playerid][h][SpawnSaveRot] = floatstr( data );
self_mysql_get_field("AH_TankVolumen", data); Carlist[playerid][h][TankVolumen] = strval( data );
self_mysql_get_field("AH_Mats", data); Carlist[playerid][h][cMats] = strval(data);
self_mysql_get_field("AH_Neon", data); Carlist[playerid][h][Neon] = strval(data);
self_mysql_get_field("AH_NeonType", data); Carlist[playerid][h][NeonType] = strval(data);
self_mysql_get_field("AH_Drugs", data); Carlist[playerid][h][cDrugs] = strval(data);
self_mysql_get_field("AH_StandTime", data); Carlist[playerid][h][StandTime] = strval(data);
self_mysql_get_field("AH_Meter", data); Carlist[playerid][h][Meter] = strval(data);
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.");}
printf("(%d,%d,%i,%i,%f,%f,%f,%f,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%f,%f,%f,%f,%i,%i,%i,%i,%i,%i,%i)",
PlayerInfo[playerid][pSQLID],h,Carlist[playerid][h][ingarage],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],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],
Carlist[playerid][h][SpawnSaveX],Carlist[playerid][h][SpawnSaveY],Carlist[playerid][h][SpawnSaveZ],
Carlist[playerid][h][SpawnSaveRot],Carlist[playerid][h][TankVolumen],Carlist[playerid][h][cMats],
Carlist[playerid][h][Neon],Carlist[playerid][h][NeonType],Carlist[playerid][h][cDrugs],Carlist[playerid][h][StandTime],
Carlist[playerid][h][Meter]);
}
}
return 1;
} -
stock EnterToLog(const log[], const logtext[]) { new filestring[512]; format(filestring, sizeof filestring, "logs/%s.txt", funktion); new File:file = fopen(filestring, io_append); fwrite(file, logtext); fclose(file); return 1; }
Error: error 017: undefined symbol "funktion" -
Wie funktioniert dieses Log System(Speicherort):
format(string,sizeof(string),"%s(%d) hat sich soebend mit der IP [%s] eingeloggt.", sendername, playerid, PlayerInfo[playerid][pUserIP]);
EnterToLog("ip",string);stock EnterToLog(const log[], const logtext[]){
#pragma unused log
#pragma unused logtext
return true;
} -
Was soll den alles in dem Anti-Cheat enthalten sein, und was zahlst du dafür?
mfg
Dies wird mit dem Scripter abgesprochen. -
Guten Abend,
Bin auf der Suche nach einer Person welche mir ein Anti-Cheat schreibt.
Bezahlungsart:
-PSC[Folgendes muss im Thema enthalten sein und darf nicht entfernt werden:]
______
Unverbindlicher Hinweis: Die Sicherheit einer Transaktion kann am besten durch die Einschaltung eines Mittelsmannes gewährleistet werden. Weitere Informationen dazu gibt es hier. -
Was kann man gegen Sobeit tun (DJN Version)
-
Wie meinst du, du kannst keine Werte eintragen?
Wo nicht eintragen?Wenn ich einen Wert eintrage kann er den nehmen aber Ingame trägt er keine neuen ein
-
Was sagt der MySQL Log?
PS: Kannst du bitte nicht immer meinen ganzen Post samt allen Codes zitieren? Das macht den Thread ziemlich unübersichtlich.
Danke.
Error:[15:02:10] CMySQLHandler::Query(UPDATE `cars` SET `ingarage`=0,`AH_Typ`=-1,`AH_X`='0.000000',`AH_Y`='0.000000',`AH_Z`='0.000000',`AH_Rot`='0.000000',`AH_Status`=0,`AH_Lock`=0,`AH_Paintjob`=-1,`Farbe1`=-1,`Farbe2`=-1,`AH_mod1`=-1,`AH_mod2`=-1,`AH_mod3`=-1,`AH_mod4`=-1,`AH_mod5`=-1,`AH_mod6`=-1,`AH_mod7`=-1,`AH_mod8`=-1,`AH_mod9`=-1,`AH_mod10`=-1,`AH_mod11`=-1,`AH_mod12`=-1,`AH_mod13`=-1,`AH_mod14`=-1,`AH_mod15`=-1,`AH_mod16`=-1,`AH_mod17`=-1,`AH_SpawnSaveX`=0.000000,`AH_SpawnSaveY`='0.000000',`AH_SpawnSaveZ`='0.000000',`AH_SpawnSaveRot`='0.000000',`AH_TankVolumen`=0,`AH_Mats`=0,`AH_Neon`=0,`AH_NeonType`=0,`AH_Drugs`=0,`AH_Versicherung`=0,`AH_StandTime`=0,`AH_Meter`=1 WHERE `sqlid`=1 AND `carkey`=) - An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1)
[15:02:10] >> mysql_query( Connection handle: 1 )
[15:02:10] CMySQLHandler::Query(UPDATE `cars` SET `ingarage`=0,`AH_Typ`=-1,`AH_X`='0.000000',`AH_Y`='0.000000',`AH_Z`='0.000000',`AH_Rot`='0.000000',`AH_Status`=0,`AH_Lock`=0,`AH_Paintjob`=-1,`Farbe1`=-1,`Farbe2`=-1,`AH_mod1`=-1,`AH_mod2`=-1,`AH_mod3`=-1,`AH_mod4`=-1,`AH_mod5`=-1,`AH_mod6`=-1,`AH_mod7`=-1,`AH_mod8`=-1,`AH_mod9`=-1,`AH_mod10`=-1,`AH_mod11`=-1,`AH_mod12`=-1,`AH_mod13`=-1,`AH_mod14`=-1,`AH_mod15`=-1,`AH_mod16`=-1,`AH_mod17`=-1,`AH_SpawnSaveX`=0.000000,`AH_SpawnSaveY`='0.000000',`AH_SpawnSaveZ`='0.000000',`AH_SpawnSaveRot`='0.000000',`AH_TankVolumen`=0,`AH_Mats`=0,`AH_Neon`=0,`AH_NeonType`=0,`AH_Drugs`=0,`AH_Versicherung`=0,`AH_StandTime`=0,`AH_Meter`=1 WHERE `sqlid`=2 AND `carkey`=) - An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1)
[15:02:10] >> mysql_query( Connection handle: 1 )public PlayerCarConnect(playerid)
{
if(IsPlayerNPC(playerid))
{
return 1;
}
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
for(new h = 0; h < MaxVeh[playerid]; h++)
{
new data[100],TextString[50];
format(TextString, sizeof(TextString), "SELECT * FROM `cars` WHERE `id`=%i", PlayerInfo[playerid][pSQLID]);
self_mysql_query(TextString);
mysql_store_result(MySQLConnection);
if(mysql_num_rows(MySQLConnection) != 0)
{
mysql_fetch_row_format(TextString);
self_mysql_get_field("id", data); Carlist[playerid][h][cid] = strval( data );
self_mysql_get_field("sqlid", data); Carlist[playerid][h][sqlid] = strval( data );
self_mysql_get_field("ingarage", data); Carlist[playerid][h][ingarage] = strval( data );
self_mysql_get_field("AH_Typ", data); Carlist[playerid][h][Typ] = strval( data );
self_mysql_get_field("AH_X", data); Carlist[playerid][h][pos_x] = floatstr( data );
self_mysql_get_field("AH_Y", data); Carlist[playerid][h][pos_y] = floatstr( data );
self_mysql_get_field("AH_Z", data); Carlist[playerid][h][pos_z] = floatstr( data );
self_mysql_get_field("AH_Rot", data); Carlist[playerid][h][z_angle] = floatstr( data );
self_mysql_get_field("AH_Status", data); Carlist[playerid][h][Status] = strval( data );
self_mysql_get_field("AH_Lock", data); Carlist[playerid][h][Lock] = strval( data );
self_mysql_get_field("AH_Paintjob", data); Carlist[playerid][h][Paintjob] = strval( data );
self_mysql_get_field("AH_Farbe1", data); Carlist[playerid][h][Farbe1] = strval( data );
self_mysql_get_field("AH_Farbe2", data); Carlist[playerid][h][Farbe2] = strval( data );
self_mysql_get_field("AH_mod1", data); Carlist[playerid][h][mod1] = strval( data );
self_mysql_get_field("AH_mod2", data); Carlist[playerid][h][mod2] = strval( data );
self_mysql_get_field("AH_mod3", data); Carlist[playerid][h][mod3] = strval( data );
self_mysql_get_field("AH_mod4", data); Carlist[playerid][h][mod4] = strval( data );
self_mysql_get_field("AH_mod5", data); Carlist[playerid][h][mod5] = strval( data );
self_mysql_get_field("AH_mod6", data); Carlist[playerid][h][mod6] = strval( data );
self_mysql_get_field("AH_mod7", data); Carlist[playerid][h][mod7] = strval( data );
self_mysql_get_field("AH_mod8", data); Carlist[playerid][h][mod8] = strval( data );
self_mysql_get_field("AH_mod9", data); Carlist[playerid][h][mod9] = strval( data );
self_mysql_get_field("AH_mod10", data); Carlist[playerid][h][mod10] = strval( data );
self_mysql_get_field("AH_mod11", data); Carlist[playerid][h][mod11] = strval( data );
self_mysql_get_field("AH_mod12", data); Carlist[playerid][h][mod12] = strval( data );
self_mysql_get_field("AH_mod13", data); Carlist[playerid][h][mod13] = strval( data );
self_mysql_get_field("AH_mod14", data); Carlist[playerid][h][mod14] = strval( data );
self_mysql_get_field("AH_mod15", data); Carlist[playerid][h][mod15] = strval( data );
self_mysql_get_field("AH_mod16", data); Carlist[playerid][h][mod16] = strval( data );
self_mysql_get_field("AH_mod17", data); Carlist[playerid][h][mod17] = strval( data );
self_mysql_get_field("AH_SpawnSaveX", data); Carlist[playerid][h][SpawnSaveX] = floatstr( data );
self_mysql_get_field("AH_SpawnSaveY", data); Carlist[playerid][h][SpawnSaveY] = floatstr( data );
self_mysql_get_field("AH_SpawnSaveZ", data); Carlist[playerid][h][SpawnSaveZ] = floatstr( data );
self_mysql_get_field("AH_SpawnSaveRot", data); Carlist[playerid][h][SpawnSaveRot] = floatstr( data );
self_mysql_get_field("AH_TankVolumen", data); Carlist[playerid][h][TankVolumen] = strval( data );
self_mysql_get_field("AH_Mats", data); Carlist[playerid][h][cMats] = strval(data);
self_mysql_get_field("AH_Neon", data); Carlist[playerid][h][Neon] = strval(data);
self_mysql_get_field("AH_NeonType", data); Carlist[playerid][h][NeonType] = strval(data);
self_mysql_get_field("AH_Drugs", data); Carlist[playerid][h][cDrugs] = strval(data);
self_mysql_get_field("AH_StandTime", data); Carlist[playerid][h][StandTime] = strval(data);
self_mysql_get_field("AH_Meter", data); Carlist[playerid][h][Meter] = strval(data);
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.");}
}
}
return 1;
}public PlayerCarUpdate(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
new string[2048], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
for(new h = 0; h < MaxVeh[playerid]; h++)
{
format(string, sizeof(string), "UPDATE `cars` SET `ingarage`=%i,`AH_Typ`=%i,`AH_X`='%f',`AH_Y`='%f',`AH_Z`='%f',`AH_Rot`='%f',`AH_Status`=%i,`AH_Lock`=%i,`AH_Paintjob`=%i,`Farbe1`=%i,`Farbe2`=%i,`AH_mod1`=%i,`AH_mod2`=%i,`AH_mod3`=%i,`AH_mod4`=%i,`AH_mod5`=%i,`AH_mod6`=%i,`AH_mod7`=%i,`AH_mod8`=%i,`AH_mod9`=%i,`AH_mod10`=%i,`AH_mod11`=%i,`AH_mod12`=%i,`AH_mod13`=%i,`AH_mod14`=%i,`AH_mod15`=%i,`AH_mod16`=%i,`AH_mod17`=%i,",
Carlist[playerid][h][ingarage],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],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]);format(string, sizeof(string),"%s`AH_SpawnSaveX`=%f,`AH_SpawnSaveY`='%f',`AH_SpawnSaveZ`='%f',`AH_SpawnSaveRot`='%f',`AH_TankVolumen`=%i,`AH_Mats`=%i,`AH_Neon`=%i,`AH_NeonType`=%i,`AH_Drugs`=%i,`AH_Versicherung`=%i,`AH_StandTime`=%i,`AH_Meter`=%i WHERE `sqlid`=%i AND `carkey`=%i",
string, Carlist[playerid][h][SpawnSaveX],Carlist[playerid][h][SpawnSaveY],Carlist[playerid][h][SpawnSaveZ],
Carlist[playerid][h][SpawnSaveRot],Carlist[playerid][h][TankVolumen],Carlist[playerid][h][cMats],
Carlist[playerid][h][Neon],Carlist[playerid][h][NeonType],Carlist[playerid][h][cDrugs],Carlist[playerid][h][StandTime],
Carlist[playerid][h][Meter],PlayerInfo[playerid][pSQLID],h);self_mysql_query(string);
}
return 1;
} -
Du musst das Feld "Paket" in die Datenbank eintragen
Jetzt zeigt er keine Errors kann jedoch in den Zeilen:
self_mysql_get_field("Onlinne", val); PlayerInfo[playerid][pOnlinne] = strval( val );
self_mysql_get_field("Festgeld", val); PlayerInfo[playerid][pFestgeld] = strval( val );
self_mysql_get_field("Festgeldpd", val); PlayerInfo[playerid][pFestPD] = strval( val );
self_mysql_get_field("BusSkill", val); PlayerInfo[playerid][pBusSkill] = strval( val );
self_mysql_get_field("Paket", val); PlayerInfo[playerid][pPaket] = strval( val );
self_mysql_get_field("Krankenhaus", val); PlayerInfo[playerid][pKrankenhaus] = strval( val );
Er kann aber keine Werte eintragen nur auslesen -
format(var, sizeof(var), "`Krankenhaus`='%d',", PlayerInfo[playerid][pKrankenhaus]);
zu
format(var, sizeof(var), "`Krankenhaus`='%d'", PlayerInfo[playerid][pKrankenhaus]);
Das wurde in den Beiträgen vorher auch schon mal erklärt
Hab ich auch schon probiert funktioniert nicht. Errors:
[11:24:45] CMySQLHandler::Query(UPDATE `users` SET `OnDutySkin`='0', `CarLicPoints`='0', `BikeLicPoints`='0', `warntime1`='0', `warntime2`='0', `Ticketsopen`='0', `DonatorTime`='-1', `OldName`='NULL', `ClientIP`='****', `OrgMember`='-1', `OrgLeader`='-1', `OrgName`='Keine',`Festgeld`='12000',`Festgeldpd`='0',`BusSkill`='0',`Paket`='0',`Krankenhaus`='0' WHERE `Name`='Heaven') - An error has occured. (Error ID: 1054, Unknown column 'Paket' in 'field list')
[11:24:45] OnQueryError() - Called.
[11:24:45] OnQueryError() - Called.
[11:24:45] OnQueryError() - Called.
[11:24:45] OnQueryError() - Called. -
Zeig noch einmal deinen aktuellen Code davon her.
format(var, sizeof(var), "`Festgeld`='%d',", PlayerInfo[playerid][pFestgeld]);
strcat(endstring, var, sizeof(endstring));
format(var, sizeof(var), "`Festgeldpd`='%d',", PlayerInfo[playerid][pFestPD]);
strcat(endstring, var, sizeof(endstring));
format(var, sizeof(var), "`BusSkill`='%d',", PlayerInfo[playerid][pBusSkill]);
strcat(endstring, var, sizeof(endstring));
format(var, sizeof(var), "`Paket`='%d',", PlayerInfo[playerid][pPaket]);
strcat(endstring, var, sizeof(endstring));
format(var, sizeof(var), "`Krankenhaus`='%d',", PlayerInfo[playerid][pKrankenhaus]);
strcat(endstring, var, sizeof(endstring));
format(var, sizeof(var), " WHERE `Name`='%s'", playername);
strcat(endstring, var, sizeof(endstring));
self_mysql_query(endstring); -
Aus dem Grund, das nach den beiden Werten nichts mehr kommt. Möchtest du nach `Krankenhaus`='0' noch was einfügen, dann muss dort ein Komma hin, sonst nicht.
Ok Error bleibt:
[11:13:15] CMySQLHandler::Query(UPDATE `users` SET `OnDutySkin`='0', `CarLicPoints`='0', `BikeLicPoints`='0', `warntime1`='0', `warntime2`='0', `Ticketsopen`='0', `DonatorTime`='-1', `OldName`='NULL', `ClientIP`='109.193.63.11', `OrgMember`='-1', `OrgLeader`='-1', `OrgName`='Keine',`Festgeld`='0',`Festgeldpd`='0',`BusSkill`='0',`Paket`='0',`Krankenhaus`='0', WHERE `Name`='Heaven') - An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `Name`='Heaven'' at line 1)
[11:13:15] OnQueryError() - Called. -
Aus welchem Grund will das ja in Zukunft nicht falsch machen. -
Dann zeig nochmal die Errors.
[00:49:18] CMySQLHandler::Query(UPDATE `users` SET `OnDutySkin`='0', `CarLicPoints`='0', `BikeLicPoints`='0', `warntime1`='0', `warntime2`='0', `Ticketsopen`='0', `DonatorTime`='-1', `OldName`='NULL', `ClientIP`='109.193.63.11', `OrgMember`='-1', `OrgLeader`='-1', `OrgName`='Keine',`Festgeld`='12000',`Festgeldpd`='0',`BusSkill`='0',`Paket`='0',`Krankenhaus`='0', WHERE `Name`='Heaven',) - An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `Name`='Heaven',' at line 1)
[00:49:18] OnQueryError() - Called.
[00:49:18] OnQueryError() - Called.
[00:49:18] OnQueryError() - Called.
[00:49:18] OnQueryError() - Called.
[00:49:40] >> mysql_ping( Connection handle: 1 )
[00:49:40] CMySQLHandler::Ping() - Connection is still alive.
[00:50:37] >> mysql_ping( Connection handle: 1 )
[00:50:37] CMySQLHandler::Ping() - Connection is still alive.
[00:51:34] >> mysql_ping( Connection handle: 1 )
[00:51:34] CMySQLHandler::Ping() - Connection is still alive.
[00:52:30] >> mysql_ping( Connection handle: 1 )
[00:52:30] CMySQLHandler::Ping() - Connection is still alive.
[00:53:27] >> mysql_ping( Connection handle: 1 )
[00:53:27] CMySQLHandler::Ping() - Connection is still alive. -
Das das so:
format(var, sizeof(var), "`Festgeld`='%d',", PlayerInfo[playerid][pFestgeld]);
strcat(endstring, var, sizeof(endstring));
format(var, sizeof(var), "`Festgeldpd`='%d',", PlayerInfo[playerid][pFestPD]);
strcat(endstring, var, sizeof(endstring));
format(var, sizeof(var), "`BusSkill`='%d',", PlayerInfo[playerid][pBusSkill]);
strcat(endstring, var, sizeof(endstring));
format(var, sizeof(var), "`Paket`='%d',", PlayerInfo[playerid][pPaket]);
strcat(endstring, var, sizeof(endstring));
format(var, sizeof(var), "`Krankenhaus`='%d',", PlayerInfo[playerid][pKrankenhaus]);
strcat(endstring, var, sizeof(endstring));
format(var, sizeof(var), " WHERE `Name`='%s',", playername);Errors bleiben jedoch
-
Nochmal: Du hast die Fehlerstellen bereits gepostet.
und hier
MySQL Syntax Errorist der gleiche Fehler ebenfalls.
Da fehlen schlicht und einfach die Kommata nach jedem Wert.
SO
format(var, sizeof(var), "`Krankenhaus`='%d'", PlayerInfo[playerid][pKrankenhaus]);Stehe glaub grad aufm Schlauch