Ok es hat geklappt
Vielen Dank Jeffry für deine Hilfe fettes Lob an dich
Beiträge von EnzO_SalvatorE
-
-
Meinst du das hier ?
Code
Alles anzeigenCMySQLHandler::Query(SELECT * FROM `gangautos` WHERE `SlotID` = '0') - Successfully executed. [12:31:54] >> mysql_store_result( Connection handle: 1 ) [12:31:54] CMySQLHandler::StoreResult() - Result was stored. [12:31:54] >> mysql_num_rows( Connection handle: 1 ) [12:31:54] CMySQLHandler::NumRows() - Returned 0 row(s) [12:31:54] >> mysql_free_result( Connection handle: 1 ) [12:31:54] CMySQLHandler::FreeResult() - Result was successfully free'd. [12:31:54] >> mysql_query( Connection handle: 1 ) [12:31:54] CMySQLHandler::Query(SELECT * FROM `gangautos` WHERE `SlotID` = '1') - Successfully executed. [12:31:54] >> mysql_store_result( Connection handle: 1 ) [12:31:54] CMySQLHandler::StoreResult() - Result was stored. [12:31:54] >> mysql_num_rows( Connection handle: 1 ) [12:31:54] CMySQLHandler::NumRows() - Returned 1 row(s) [12:31:54] >> mysql_fetch_row_format( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchRow() - Return: 1|-1|-1|-1|0|0|0|0|-1|-1|-1|50|1800 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("CarID") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("OwnerID") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("TypID") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("PosX") - 0 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("PosY") - 0 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("PosZ") - 0 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("Rotation") - 0 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("Farbe1") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("Farbe2") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("Status") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("Tank") - 50 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("ReSpawnTime") - 1800 [12:31:54] >> mysql_free_result( Connection handle: 1 ) [12:31:54] CMySQLHandler::FreeResult() - Result was successfully free'd. [12:31:54] >> mysql_query( Connection handle: 1 ) [12:31:54] CMySQLHandler::Query(SELECT * FROM `gangautos` WHERE `SlotID` = '2') - Successfully executed. [12:31:54] >> mysql_store_result( Connection handle: 1 ) [12:31:54] CMySQLHandler::StoreResult() - Result was stored. [12:31:54] >> mysql_num_rows( Connection handle: 1 ) [12:31:54] CMySQLHandler::NumRows() - Returned 1 row(s) [12:31:54] >> mysql_fetch_row_format( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchRow() - Return: 2|-1|-1|-1|0|0|0|0|-1|-1|-1|50|1800 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("CarID") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("OwnerID") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("TypID") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("PosX") - 0 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("PosY") - 0 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("PosZ") - 0 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("Rotation") - 0 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("Farbe1") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("Farbe2") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("Status") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("Tank") - 50 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("ReSpawnTime") - 1800 [12:31:54] >> mysql_free_result( Connection handle: 1 ) [12:31:54] CMySQLHandler::FreeResult() - Result was successfully free'd. [12:31:54] >> mysql_query( Connection handle: 1 ) [12:31:54] CMySQLHandler::Query(SELECT * FROM `gangautos` WHERE `SlotID` = '3') - Successfully executed. [12:31:54] >> mysql_store_result( Connection handle: 1 ) [12:31:54] CMySQLHandler::StoreResult() - Result was stored. [12:31:54] >> mysql_num_rows( Connection handle: 1 ) [12:31:54] CMySQLHandler::NumRows() - Returned 1 row(s) [12:31:54] >> mysql_fetch_row_format( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchRow() - Return: 3|-1|-1|-1|0|0|0|0|-1|-1|-1|50|1800 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("CarID") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("OwnerID") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("TypID") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("PosX") - 0 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("PosY") - 0 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("PosZ") - 0 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("Rotation") - 0 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("Farbe1") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("Farbe2") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("Status") - -1 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("Tank") - 50 [12:31:54] >> mysql_fetch_field_row( Connection handle: 1 ) [12:31:54] CMySQLHandler::FetchField("ReSpawnTime") - 1800 [12:31:54] >> mysql_free_result( Connection handle: 1 ) [12:31:54] CMySQLHandler::FreeResult() - Result was successfully free'd. [12:31:54] >> mysql_query( Connection handle: 1 )
Oder das hier?
Code
Alles anzeigenCMySQLHandler::Query(SELECT * FROM `gangautos` WHERE `SlotID` = '0') - Successfully executed. [12:33:50] >> mysql_store_result( Connection handle: 1 ) [12:33:50] CMySQLHandler::StoreResult() - Result was stored. [12:33:50] >> mysql_num_rows( Connection handle: 1 ) [12:33:50] CMySQLHandler::NumRows() - Returned 0 row(s) [12:33:50] >> mysql_query( Connection handle: 1 ) [12:33:50] CMySQLHandler::Query(INSERT INTO `gangautos` (`SlotID`) VALUES ('0')) - Successfully executed. [12:33:50] >> mysql_free_result( Connection handle: 1 ) [12:33:50] CMySQLHandler::FreeResult() - Result was successfully free'd. [12:33:50] >> mysql_query( Connection handle: 1 ) [12:33:50] CMySQLHandler::Query(UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='1800' WHERE `SlotID`='0') - Successfully executed. [12:33:50] >> mysql_query( Connection handle: 1 ) [12:33:50] CMySQLHandler::Query(SELECT * FROM `gangautos` WHERE `SlotID` = '1') - Successfully executed. [12:33:50] >> mysql_store_result( Connection handle: 1 ) [12:33:50] CMySQLHandler::StoreResult() - Result was stored. [12:33:50] >> mysql_num_rows( Connection handle: 1 ) [12:33:50] CMySQLHandler::NumRows() - Returned 1 row(s) [12:33:50] >> mysql_free_result( Connection handle: 1 ) [12:33:50] CMySQLHandler::FreeResult() - Result was successfully free'd. [12:33:50] >> mysql_query( Connection handle: 1 ) [12:33:50] CMySQLHandler::Query(UPDATE `gangautos` SET `CarID`='535', `OwnerID`='24', `TypID`='480', `PosX`='411.0', `PosY`='2442.0', `PosZ`='18.0', `Rotation`='90.0', `Farbe1`='6', `Farbe2`='6', `Status`='0', `Tank`='100', `ReSpawnTime`='1800' WHERE `SlotID`='1') - Successfully executed. [12:33:50] >> mysql_query( Connection handle: 1 ) [12:33:50] CMySQLHandler::Query(SELECT * FROM `gangautos` WHERE `SlotID` = '2') - Successfully executed. [12:33:50] >> mysql_store_result( Connection handle: 1 ) [12:33:50] CMySQLHandler::StoreResult() - Result was stored. [12:33:50] >> mysql_num_rows( Connection handle: 1 ) [12:33:50] CMySQLHandler::NumRows() - Returned 1 row(s) [12:33:50] >> mysql_free_result( Connection handle: 1 ) [12:33:50] CMySQLHandler::FreeResult() - Result was successfully free'd. [12:33:50] >> mysql_query( Connection handle: 1 ) [12:33:50] CMySQLHandler::Query(UPDATE `gangautos` SET `CarID`='536', `OwnerID`='24', `TypID`='560', `PosX`='411.0', `PosY`='2442.0', `PosZ`='18.0', `Rotation`='90.0', `Farbe1`='6', `Farbe2`='6', `Status`='0', `Tank`='100', `ReSpawnTime`='1800' WHERE `SlotID`='2') - Successfully executed. [12:33:50] >> mysql_query( Connection handle: 1 ) [12:33:50] CMySQLHandler::Query(SELECT * FROM `gangautos` WHERE `SlotID` = '3') - Successfully executed. [12:33:50] >> mysql_store_result( Connection handle: 1 ) [12:33:50] CMySQLHandler::StoreResult() - Result was stored. [12:33:50] >> mysql_num_rows( Connection handle: 1 ) [12:33:50] CMySQLHandler::NumRows() - Returned 1 row(s) [12:33:50] >> mysql_free_result( Connection handle: 1 ) [12:33:50] CMySQLHandler::FreeResult() - Result was successfully free'd. [12:33:50] >> mysql_query( Connection handle: 1 )
-
Jetzt habe ich grade das Problem das im MySQL Log nichts steht
-
Ich habe jetzt die Tabelle gelöscht und neu erstellen lassen daraufhin erneut 3 Autos gekauft doch immer noch das gleiche Problem das, dass erste Auto nicht gepspeichert wird
-
Code
Alles anzeigenpublic SaveGangAutos() { if(SaveServerMySQL == 0) { new idx; new File: file2; idx = 0; while (idx < sizeof(GangAutoInfo)) { if(TankSave == 1) { if(GangAutoInfo[idx][cID] != -1) { GangAutoInfo[idx][cTank] = Gas[GangAutoInfo[idx][cID]]; } } new coordsstring[128]; format(coordsstring, sizeof(coordsstring), "%d|%d|%d|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d\n", GangAutoInfo[idx][cID], GangAutoInfo[idx][cOwner], GangAutoInfo[idx][cTyp], GangAutoInfo[idx][cPosX], GangAutoInfo[idx][cPosY], GangAutoInfo[idx][cPosZ], GangAutoInfo[idx][cRot], GangAutoInfo[idx][cColor1], GangAutoInfo[idx][cColor2], GangAutoInfo[idx][cStatus], GangAutoInfo[idx][cTank], GangAutoInfo[idx][cReSpawnTime], GangAutoInfo[idx][cStandTime], GangAutoInfo[idx][cMeter]); if(idx == 0) { file2 = fopen("Configs/cars.cfg", io_write); } else { file2 = fopen("Configs/cars.cfg", io_append); } fwrite(file2, coordsstring); idx++; fclose(file2); } print("GangAutos Geladen"); } else { new string[256]; for(new i = 0; i < sizeof(GangAutoInfo); i++) { if(TankSave == 1) { if(GangAutoInfo[i][cID] != -1) { GangAutoInfo[i][cTank] = Gas[GangAutoInfo[i][cID]]; } } format(string, sizeof(string), "SELECT * FROM `gangautos` WHERE `SlotID` = '%d'", i); self_mysql_query(string); mysql_store_result(MySQLConnection); if(mysql_num_rows(MySQLConnection) == 0) { format(string, sizeof(string), "INSERT INTO `gangautos` (`SlotID`) VALUES ('%d')", i); self_mysql_query(string); } mysql_free_result(MySQLConnection); new var[256]; format(var, sizeof(var), "UPDATE `gangautos` SET `CarID`='%d', `OwnerID`='%d', `TypID`='%d', `PosX`='%.1f', `PosY`='%.1f', `PosZ`='%.1f', `Rotation`='%.1f', `Farbe1`='%d', `Farbe2`='%d', `Status`='%d', `Tank`='%d', `ReSpawnTime`='%d' WHERE `SlotID`='%d'", GangAutoInfo[i][cID], GangAutoInfo[i][cOwner], GangAutoInfo[i][cTyp], GangAutoInfo[i][cPosX], GangAutoInfo[i][cPosY], GangAutoInfo[i][cPosZ], GangAutoInfo[i][cRot], GangAutoInfo[i][cColor1], GangAutoInfo[i][cColor2], GangAutoInfo[i][cStatus], GangAutoInfo[i][cTank], GangAutoInfo[i][cReSpawnTime], //GangAutoInfo[i][cStandTime], i); self_mysql_query(var); } print("GangAutos Geladen"); } return 1; }
http://250kb.de/u/160115/p/A4B34UBzajY8.png
http://250kb.de/u/160115/p/u0o4lUf4ztqG.pngSo sieht alles grade aus
-
-
Hab es eingefügt und nochmal die Autos gekauft jetzt siehts so aus
http://250kb.de/u/160115/p/IppfoWcSX3ju.png
http://250kb.de/u/160115/p/rGYDQPNvh4oN.png -
Ich habe nach dieser Reihenfolge die Autos gekauft
1. Bullet (wurde nicht gespeichert)
2. Infernus
3. Comethttp://250kb.de/u/160115/p/CoUuyycSniD8.png
http://250kb.de/u/160115/p/TmXlHpGJWZ57.png -
public LoadGangAutos()
{
if(SaveServerMySQL == 0)
{
new arrCoords[14][64];
new strFromFile2[256];
new File: file = fopen("Configs/cars.cfg", io_read);
if (file)
{
new idx;
while (idx < sizeof(GangAutoInfo)){
fread(file, strFromFile2);
split(strFromFile2, arrCoords, '|');
GangAutoInfo[idx][cID] = strval(arrCoords[0]);
GangAutoInfo[idx][cOwner] = strval(arrCoords[1]);
GangAutoInfo[idx][cTyp] = strval(arrCoords[2]);
GangAutoInfo[idx][cPosX] = floatstr(arrCoords[3]);
GangAutoInfo[idx][cPosY] = floatstr(arrCoords[4]);
GangAutoInfo[idx][cPosZ] = floatstr(arrCoords[5]);
GangAutoInfo[idx][cRot] = floatstr(arrCoords[6]);
GangAutoInfo[idx][cColor1] = strval(arrCoords[7]);
GangAutoInfo[idx][cColor2] = strval(arrCoords[8]);
GangAutoInfo[idx][cStatus] = strval(arrCoords[9]);
GangAutoInfo[idx][cTank] = strval(arrCoords[10]);
GangAutoInfo[idx][cReSpawnTime] = strval(arrCoords[11]);
GangAutoInfo[idx][cStandTime] = strval(arrCoords[12]);
GangAutoInfo[idx][cMeter] = strval(arrCoords[13]);
if(GangAutoInfo[idx][cStandTime] == 0)
{
GangAutoInfo[idx][cStandTime] = Time();
}
idx++;
}
fclose(file);
}
}
else
{
new string[128];
for(new i = 0; i < sizeof(GangAutoInfo); i++)
{
format(string, sizeof(string),"SELECT * FROM `gangautos` WHERE `SlotID` = '%d'", i);
self_mysql_query(string);
mysql_store_result(MySQLConnection);
if(mysql_num_rows(MySQLConnection) != 0)
{
mysql_fetch_row_format(string);
new val[ 256 ];
self_mysql_get_field("CarID", val); GangAutoInfo[i][cID] = strval( val );
self_mysql_get_field("OwnerID", val); GangAutoInfo[i][cOwner] = strval( val );
self_mysql_get_field("TypID", val); GangAutoInfo[i][cTyp] = strval( val );
self_mysql_get_field("PosX", val); GangAutoInfo[i][cPosX] = floatstr( val );
self_mysql_get_field("PosY", val); GangAutoInfo[i][cPosY] = floatstr( val );
self_mysql_get_field("PosZ", val); GangAutoInfo[i][cPosZ] = floatstr( val );
self_mysql_get_field("Rotation", val); GangAutoInfo[i][cRot] = floatstr( val );
self_mysql_get_field("Farbe1", val); GangAutoInfo[i][cColor1] = strval( val );
self_mysql_get_field("Farbe2", val); GangAutoInfo[i][cColor2] = strval( val );
self_mysql_get_field("Status", val); GangAutoInfo[i][cStatus] = strval( val );
self_mysql_get_field("Tank", val); GangAutoInfo[i][cTank] = strval( val );
self_mysql_get_field("ReSpawnTime", val); GangAutoInfo[i][cReSpawnTime] = strval( val );
//self_mysql_get_field("StandTime", val); GangAutoInfo[i][cStandTime] = strval( val );
}
else
{
GangAutoInfo[i][cID] = -1;
GangAutoInfo[i][cOwner] = -1;
GangAutoInfo[i][cTyp] = -1;
GangAutoInfo[i][cPosX] = 0;
GangAutoInfo[i][cPosY] = 0;
GangAutoInfo[i][cPosZ] = 0;
GangAutoInfo[i][cRot] = 0;
GangAutoInfo[i][cColor1] = -1;
GangAutoInfo[i][cColor2] = -1;
GangAutoInfo[i][cStatus] = -1;
GangAutoInfo[i][cTank] = 50;
GangAutoInfo[i][cReSpawnTime] = 1800;
GangAutoInfo[i][cStandTime] = 0;
}
mysql_free_result(MySQLConnection);
if(GangAutoInfo[i][cID] == 65535)
{
GangAutoInfo[i][cID] = -1;
}
}
}
return 1;
} -
Also das läuft so ab ich kaufe zum Beispiel jetzt 3 Autos die spawnen auch ganz normal nur nachdem Serverrestart ist das erst gekaufte Fahrezeug weg und die 2 daraufhin gekauften Fahrzeuge sind da.
Und das passiert immer wieder beim Kauf. -
public CreateGangAutos()
{
for(new h = 0; h < sizeof(GangAutoInfo); h++){
if(GangAutoInfo[h][cTyp] != -1){
if(GangAutoInfo[h][cStatus] == 0){
GangAutoInfo[h][cID] = CreateVehicle(GangAutoInfo[h][cTyp],GangAutoInfo[h][cPosX],GangAutoInfo[h][cPosY],GangAutoInfo[h][cPosZ],GangAutoInfo[h][cRot],GangAutoInfo[h][cColor1],GangAutoInfo[h][cColor2],GangAutoInfo[h][cReSpawnTime]);
Gas[GangAutoInfo[h][cID]] = GangAutoInfo[h][cTank];
new string[50];
format(string, sizeof(string), "{FFFF00}ir-{21DD00}%d", GangAutoInfo[h][cID]);
SetVehicleNumberPlate(GangAutoInfo[h][cID],string);
}}}
return 1;
}public CreateNewlyGangAutos(GCarID)
{
if(GangAutoInfo[GCarID][cTyp] != -1)
{
if(GangAutoInfo[GCarID][cID] == -1)
{
if(GangAutoInfo[GCarID][cStatus] == 0)
{
GangAutoInfo[GCarID][cID] = CreateVehicle(GangAutoInfo[GCarID][cTyp],GangAutoInfo[GCarID][cPosX],GangAutoInfo[GCarID][cPosY],GangAutoInfo[GCarID][cPosZ],GangAutoInfo[GCarID][cRot],GangAutoInfo[GCarID][cColor1],GangAutoInfo[GCarID][cColor2],GangAutoInfo[GCarID][cReSpawnTime]);
Gas[GangAutoInfo[GCarID][cID]] = GangAutoInfo[GCarID][cTank];
new string[50];
format(string, sizeof(string), "{FFFF00}ir-{21DD00}%d", GangAutoInfo[GCarID][cID]);
SetVehicleNumberPlate(GangAutoInfo[GCarID][cID],string);
}
}
}return 1;
}
if(strcmp("/buygangcar", cmd, true) == 0)
{
if(PlayerInfo[playerid][pLeader] != -1 || PlayerInfo[playerid][pRank] == 12)
{
new Farbe,
GangCars = 0;
if(PlayerInfo[playerid][pTeam] == 4 || PlayerInfo[playerid][pTeam] == 14 || PlayerInfo[playerid][pTeam] == 7 || PlayerInfo[playerid][pTeam] == 16)
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Deine Fraktion ist nicht Berechtigt Gangautos zu Kaufen.");
return 1;
}
if(IsPlayerInAnyVehicle(playerid) && GangAutoSpectating[playerid] != -1)
{
new GangAutoPreis = GangAutoKaufliste[GangAutoSpectating[playerid]][GAPreis];
if(GangAutoPreis >= KassenInfo[PlayerInfo[playerid][pTeam]][tKasse])
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Es ist nicht mehr genug Geld in der Teamkasse !");
return 1;
}
else
{
if(PlayerInfo[playerid][pTeam] == 1)
{
Farbe = 0;
}
if(PlayerInfo[playerid][pTeam] == 2)
{
Farbe = 154;
}
if(PlayerInfo[playerid][pTeam] == 3)
{
Farbe = 120;
}
if(PlayerInfo[playerid][pTeam] == 4)
{
Farbe = 3;
}
if(PlayerInfo[playerid][pTeam] == 5)
{
Farbe = 0;
}
if(PlayerInfo[playerid][pTeam] == 6)
{
Farbe = 8;
}
if(PlayerInfo[playerid][pTeam] == 7)
{
Farbe = -1;
}
if(PlayerInfo[playerid][pTeam] == 8)
{
Farbe = -1;
}
if(PlayerInfo[playerid][pTeam] == 9)
{
Farbe = 61;
}
if(PlayerInfo[playerid][pTeam] == 10)
{
Farbe = -1;
}
if(PlayerInfo[playerid][pTeam] == 11)
{
Farbe = 1;
}
if(PlayerInfo[playerid][pTeam] == 12)
{
Farbe = 0;
}
if(PlayerInfo[playerid][pTeam] == 13)
{
Farbe = 1;
}
if(PlayerInfo[playerid][pTeam] == 14)
{
Farbe = -1;
}
if(PlayerInfo[playerid][pTeam] == 15)
{
Farbe = 0;
}
if(PlayerInfo[playerid][pTeam] == 16)
{
Farbe = -1;
}
if(PlayerInfo[playerid][pTeam] == 17)
{
Farbe = 152;
}
if(PlayerInfo[playerid][pTeam] == 18)
{
Farbe = 93;
}
if(PlayerInfo[playerid][pTeam] == 19)
{
Farbe = 86;
}
if(PlayerInfo[playerid][pTeam] == 20)
{
Farbe = 85;
}
if(PlayerInfo[playerid][pTeam] == 21)
{
Farbe = 66;
}
if(PlayerInfo[playerid][pTeam] == 22)
{
Farbe = 79;
}
if(PlayerInfo[playerid][pTeam] == 23)
{
Farbe = 3;
}
if(PlayerInfo[playerid][pTeam] == 24)
{
Farbe = 6;
}
if(PlayerInfo[playerid][pTeam] == 25)
{
Farbe = 104;
}
if(PlayerInfo[playerid][pTeam] == 26)
{
Farbe = 123;
}
for(new h = 0; h < sizeof(GangAutoInfo); h++){
if(GangAutoInfo[h][cOwner] == PlayerInfo[playerid][pTeam])
{
GangCars += 1;
}
if(GangCars >= 25)
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Deine Gang hat schon 25 Gangautos!");
return 1;
}
}
for(new h = 0; h < sizeof(GangAutoInfo); h++){
if(GangAutoInfo[h][cOwner] == -1 && GangAutoInfo[h][cTyp] == -1 && GangAutoInfo[h][cColor1] == -1 && GangAutoInfo[h][cColor2] == -1){
GangAutoInfo[h][cOwner] = PlayerInfo[playerid][pTeam];
GangAutoInfo[h][cID] = -1;
GangAutoInfo[h][cTyp] = GangAutoKaufliste[GangAutoSpectating[playerid]][GAModelid];
new Zufall = random(4);
if(Zufall == 0)
{
GangAutoInfo[h][cPosX] = 391;
GangAutoInfo[h][cPosY] = 2442;
GangAutoInfo[h][cPosZ] = 18;
}
else if(Zufall == 1)
{
GangAutoInfo[h][cPosX] = 401;
GangAutoInfo[h][cPosY] = 2442;
GangAutoInfo[h][cPosZ] = 18;
}
else if(Zufall == 2)
{
GangAutoInfo[h][cPosX] = 411;
GangAutoInfo[h][cPosY] = 2442;
GangAutoInfo[h][cPosZ] = 18;
}
else
{
GangAutoInfo[h][cPosX] = 421;
GangAutoInfo[h][cPosY] = 2442;
GangAutoInfo[h][cPosZ] = 18;
}
GangAutoInfo[h][cRot] = 90;
GangAutoInfo[h][cColor1] = Farbe;
GangAutoInfo[h][cColor2] = Farbe;
GangAutoInfo[h][cStatus] = 0;
GangAutoInfo[h][cTank] = 100;
GangAutoInfo[h][cMeter] = 0;
CreateNewlyGangAutos(h);
KassenInfo[PlayerInfo[playerid][pTeam]][tKasse] -= GangAutoPreis;
format(string, sizeof(string), "Gang Car erfolgreich gekauft für %s$, das Geld wurde von der Teamkasse abgezogen.", GetPoint(GangAutoPreis));
SendClientMessage(playerid, COLOR_YELLOW, string);
SetPlayerCheckpoint(playerid,403.7779,2478.6750,16.4844,5.0);
SendClientMessage(playerid, COLOR_GRAD2,"Du Kannst dir das Fahrzeug am roten Checkpoint abholen.");
TogglePlayerControllable(playerid,1);
ForAllPlayers(i){
if(IsPlayerConnected(i)){
SetVehicleParamsForPlayer(GangAutoKaufliste[GangAutoSpectating[playerid]][GACarid],i,0,0);
}}
GangAutoSpectating[playerid] = -1;
RemovePlayerFromVehicle(playerid);
break;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Du besichtigst kein Gang Auto !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Du bist kein Leader !");
return 1;
}
return 1;
} -
Code
Alles anzeigen[20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='1800' WHERE `SlotID`='0' [20:00:24] UPDATE `gangautos` SET `CarID`='533', `OwnerID`='5', `TypID`='411', `PosX`='421.0', `PosY`='2442.0', `PosZ`='18.0', `Rotation`='90.0', `Farbe1`='0', `Farbe2`='0', `Status`='0', `Tank`='100', `ReSpawnTime`='2000' WHERE `SlotID`='1' [20:00:24] UPDATE `gangautos` SET `CarID`='534', `OwnerID`='5', `TypID`='541', `PosX`='411.0', `PosY`='2442.0', `PosZ`='18.0', `Rotation`='90.0', `Farbe1`='0', `Farbe2`='0', `Status`='0', `Tank`='100', `ReSpawnTime`='2000' WHERE `SlotID`='2' [20:00:24] UPDATE `gangautos` SET `CarID`='535', `OwnerID`='19', `TypID`='560', `PosX`='421.0', `PosY`='2442.0', `PosZ`='18.0', `Rotation`='90.0', `Farbe1`='86', `Farbe2`='86', `Status`='0', `Tank`='100', `ReSpawnTime`='2000' WHERE `SlotID`='3' [20:00:24] UPDATE `gangautos` SET `CarID`='536', `OwnerID`='19', `TypID`='480', `PosX`='401.0', `PosY`='2442.0', `PosZ`='18.0', `Rotation`='90.0', `Farbe1`='86', `Farbe2`='86', `Status`='0', `Tank`='100', `ReSpawnTime`='2000' WHERE `SlotID`='4' [20:00:24] UPDATE `gangautos` SET `CarID`='537', `OwnerID`='19', `TypID`='541', `PosX`='401.0', `PosY`='2442.0', `PosZ`='18.0', `Rotation`='90.0', `Farbe1`='86', `Farbe2`='86', `Status`='0', `Tank`='100', `ReSpawnTime`='2000' WHERE `SlotID`='5' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='6' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='7' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='8' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='9' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='10' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='11' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='12' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='13' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='14' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='15' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='16' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='17' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='18' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='19' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='20' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='21' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='22' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='23' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='24' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='25' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='26' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='27' [20:00:24] UPDATE `gangautos` SET `CarID`='-1', `OwnerID`='-1', `TypID`='-1', `PosX`='0.0', `PosY`='0.0', `PosZ`='0.0', `Rotation`='0.0', `Farbe1`='-1', `Farbe2`='-1', `Status`='-1', `Tank`='50', `ReSpawnTime`='2000' WHERE `SlotID`='28'
Ich weiß nicht ob das ,dass ist was du meinst
-
Schönen Guten Tag Breadfish Community,
und zwar beinhaltet mein Script ein Gangautosystem was auf Mysql basiert.
Das Problem besteht darin das, dass erst gekaufte Gangauto nicht in die Datenbank gespeichert wird sondern nur die darauf gefolgten Fahrzeuge.Ich bitte um Hilfe bei diesem Problem
Mit freundichen Grüßen
Enzo Salvatorepublic SaveGangAutos()
{
if(SaveServerMySQL == 0)
{
new idx;
new File: file2;
idx = 0;
while (idx < sizeof(GangAutoInfo))
{
if(TankSave == 1)
{
if(GangAutoInfo[idx][cID] != -1)
{
GangAutoInfo[idx][cTank] = Gas[GangAutoInfo[idx][cID]];
}
}
new coordsstring[128];
format(coordsstring, sizeof(coordsstring), "%d|%d|%d|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d\n",
GangAutoInfo[idx][cID],
GangAutoInfo[idx][cOwner],
GangAutoInfo[idx][cTyp],
GangAutoInfo[idx][cPosX],
GangAutoInfo[idx][cPosY],
GangAutoInfo[idx][cPosZ],
GangAutoInfo[idx][cRot],
GangAutoInfo[idx][cColor1],
GangAutoInfo[idx][cColor2],
GangAutoInfo[idx][cStatus],
GangAutoInfo[idx][cTank],
GangAutoInfo[idx][cReSpawnTime],
GangAutoInfo[idx][cStandTime],
GangAutoInfo[idx][cMeter]);
if(idx == 0)
{
file2 = fopen("Configs/cars.cfg", io_write);
}
else
{
file2 = fopen("Configs/cars.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
print("GangAutos Geladen");
}
else
{
new string[256];
for(new i = 0; i < sizeof(GangAutoInfo); i++)
{
if(TankSave == 1)
{
if(GangAutoInfo[i][cID] != -1)
{
GangAutoInfo[i][cTank] = Gas[GangAutoInfo[i][cID]];
}
}
format(string, sizeof(string), "SELECT * FROM `gangautos` WHERE `SlotID` = '%d'", i);
self_mysql_query(string);
mysql_store_result(MySQLConnection);
if(mysql_num_rows(MySQLConnection) == 0)
{
format(string, sizeof(string), "INSERT INTO `gangautos` (`SlotID`) VALUES ('%d')", i);
self_mysql_query(string);
}
mysql_free_result(MySQLConnection);
new var[256];
format(var, sizeof(var), "UPDATE `gangautos` SET `CarID`='%d', `OwnerID`='%d', `TypID`='%d', `PosX`='%.1f', `PosY`='%.1f', `PosZ`='%.1f', `Rotation`='%.1f', `Farbe1`='%d', `Farbe2`='%d', `Status`='%d', `Tank`='%d', `ReSpawnTime`='%d' WHERE `SlotID`='%d'",
GangAutoInfo[i][cID],
GangAutoInfo[i][cOwner],
GangAutoInfo[i][cTyp],
GangAutoInfo[i][cPosX],
GangAutoInfo[i][cPosY],
GangAutoInfo[i][cPosZ],
GangAutoInfo[i][cRot],
GangAutoInfo[i][cColor1],
GangAutoInfo[i][cColor2],
GangAutoInfo[i][cStatus],
GangAutoInfo[i][cTank],
GangAutoInfo[i][cReSpawnTime],
//GangAutoInfo[i][cStandTime],
i);
self_mysql_query(var);
}
print("GangAutos Geladen");
}
return 1;
}