20.05.2015, 16:03
Okay..
I get this error everytime i buy a vehicle.
Everytime i buy a vehicle it wont save the vehicle in my mysql table and it gives me a bug. Which says i got 1 vehicle but it dosent show the stats of the vehicle even its supposed to. I noticed in my user table in my mysql it saves the vehicle in the user table but not in the ownedvehicle table.
This is my MySQL stock of the vehicle
I get this error everytime i buy a vehicle.
Quote:
mysql_tquery - callback parameter count does not match format specifier length |
This is my MySQL stock of the vehicle
Код:
stock OnOwnedVehicleInsert(vehid) { VehicleInfo[vehid][carID] = cache_insert_id(); return 1; } 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, plate, owner, owned, slot) VALUES (%d, %d, %d, %f, %f, %f, %f, '%s', '%s', %d, %d)", model, color1, color2, ParkX, ParkY, ParkZ, ParkA, plate, owner, 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; } stock UpdateVehicleStatus(playerid, vehicle) { new slot = PlayerInfo[playerid][pVehSlot]; VehicleStatus[playerid][slot][carAlarm] = VehicleInfo[vehicle][carAlarm]; VehicleStatus[playerid][slot][carLock] = VehicleInfo[vehicle][carLock]; VehicleStatus[playerid][slot][carImmob] = VehicleInfo[vehicle][carImmob]; VehicleStatus[playerid][slot][carInsurances] = VehicleInfo[vehicle][carInsurances]; VehicleStatus[playerid][slot][carDestroyed] = VehicleInfo[vehicle][carDestroyed]; VehicleStatus[playerid][slot][carGps] = VehicleInfo[vehicle][carGps]; return 1; }