I've discoverd a critical error in my script this makes it unable to save the player owned vehicles (I think?)
I've kniow Idea what I've to do to fix this I tried to change the INT numbers in the database but that didn't help
This is the script where it should save the ownedvehicles but it only saves the information under: Users
PHP код:
stock OnPlayerBuyCar(playerid, vehid, model, color1, color2, slot, Float:ParkX, Float:ParkY, Float:ParkZ, Float:ParkA, plate[], owner[])
{
//======================================================================================
format(query, sizeof(query), "INSERT INTO `ownedvehicles` (model, color1, color2, parkx, parky, parkz, parka) VALUES (%d, %d, %d, %f, %f, %f, %f)", model, color1, color2, ParkX, ParkY, ParkZ, ParkA);
format(query, sizeof(query), "INSERT INTO `ownedvehicles` (plate, owner, owned, slot) VALUES ('%s', '%s', %d, %d)", plate, owner, owned, slot 1, slot);
mysql_function_query(dbHandle, query, true, "OnOwnedVehicleInsert", "%d", vehid);
//======================================================================================
format(query, sizeof(query), "UPDATE `ownedvehicles` SET `alarm` = %d, `lock` = %d, `immob` = %d, `insurances` = %d, `destroys` = %d, `gps` = %d, `fuel` = %d, `registered` = %d, `broken` = %d WHERE `owner` = '%s' AND `slot` = %d",
0, 0, 0, 2, 0, 0, 50, 1, 0, GetName(playerid), slot);
mysql_function_query(dbHandle, query, false, "", "");
//======================================================================================
format(query, sizeof(query), "UPDATE `ownedvehicles` SET `weapons` = '%s' WHERE `owner` = '%s' AND `slot` = %d", "0=0|0=0|0=0|0=0|0=0|0=0|0=0|0=0|0=0|0=0", GetName(playerid),slot);
mysql_function_query(dbHandle, query, false, "", "");
//======================================================================================
format(query, sizeof(query), "UPDATE `ownedvehicles` SET `comp0` = %d, `comp1` = %d, `comp2` = %d, `comp3` = %d, `comp4` = %d, `comp5` = %d, `comp6` = %d WHERE `owner` = '%s' AND `slot` = %d",
0, 0, 0, 0, 0, 0, 0, GetName(playerid), slot);
mysql_function_query(dbHandle, query, false, "", "");
//=====================================================================================
format(query, sizeof(query), "UPDATE `ownedvehicles` SET `comp7` = %d, `comp8` = %d, `comp9` = %d, `comp10` = %d, `comp11` = %d, `comp12` = %d, `comp13` = %d, `paintjob` = %d WHERE `owner` = '%s' AND `slot` = %d",
0, 0, 0, 0, 0, 0, 0, 3, GetName(playerid), slot);
mysql_function_query(dbHandle, query, false, "", "");
//=====================================================================================
format(query, sizeof(query), "UPDATE `ownedvehicles` SET `radio` = %d, `tickets` = '%s', `dupkey` = %d, `comps` = %d WHERE `owner` = '%s' AND `slot` = %d", 0, "0|0|0|0|0|0|0|0|0|0", VehicleInfo[vehid][carDupKey], 0, GetName(playerid), slot);
mysql_function_query(dbHandle, query, false, "", "");
//=====================================================================================
format(query, sizeof(query), "UPDATE `ownedvehicles` SET `drugs` = '%s' WHERE `owner` = '%s' AND `slot` = %d", "0=0|0=0|0=0|0=0|0=0|0=0|0=0|0=0|0=0|0=0|0=0|0=0|0=0|0=0|0=0|0=0|0=0|0=0|0=0|0=0", GetName(playerid), slot);
mysql_function_query(dbHandle, query, false, "", "");
//=====================================================================================
format(query, sizeof(query), "UPDATE `users` SET `vehicles` = %d WHERE `name` = '%s'", PlayerInfo[playerid][pVehicles], GetName(playerid));
mysql_function_query(dbHandle, query, false, "", "");
//======================================================================================
if(slot == 1)
{
format(query, sizeof(query), "UPDATE `users` SET `veh1` = '%s' WHERE `name` = '%s'", VehicleNames[model-400], GetName(playerid));
format(PlayerVehicle[playerid][pVeh1], 128, "%s", VehicleNames[model-400]);
mysql_function_query(dbHandle, query, false, "", "");
}
else if(slot == 2)
{
format(query, sizeof(query), "UPDATE `users` SET `veh2` = '%s' WHERE `name` = '%s'", VehicleNames[model-400], GetName(playerid));
format(PlayerVehicle[playerid][pVeh2], 128, "%s", VehicleNames[model-400]);
mysql_function_query(dbHandle, query, false, "", "");
}
else if(slot == 3)
{
format(query, sizeof(query), "UPDATE `users` SET `veh3` = '%s' WHERE `name` = '%s'", VehicleNames[model-400], GetName(playerid));
format(PlayerVehicle[playerid][pVeh3], 128, "%s", VehicleNames[model-400]);
mysql_function_query(dbHandle, query, false, "", "");
}
//======================================================================================
return 1;
}
And then post your error log that is located in debug.txt in your main server folder.
(( If it prints the same, change mysql_debug(1) to mysql_debug(LOG_ERROR | LOG_WARNING) ))