25.01.2018, 11:20
PHP код:
// Character's Vehicles
format(sz_Query, sizeof(sz_Query), "CREATE TABLE IF NOT EXISTS `char_vehicles` ");
format(sz_Query, sizeof(sz_Query), "%s(", sz_Query);
for(new i; i < MAX_PLAYERVEHICLES; i++)
{
if(i >= MAX_PLAYERVEHICLES-1)
{
format(sz_Query, sizeof(sz_Query), "%s`pv%dPosX` FLOAT DEFAULT 0.0, `pv%dPosY` FLOAT DEFAULT 0.0, `pv%dPosZ` FLOAT DEFAULT 0.0, `pv%dPosAngle` FLOAT DEFAULT 0.0, `pv%dModelId` INTEGER DEFAULT 0, `pv%dLock` INTEGER DEFAULT 0, `pv%dLocked` INTEGER DEFAULT 0, `pv%dPaintJob` INTEGER DEFAULT 0, `pv%dColor1` INTEGER DEFAULT 0, `pv%dColor2` INTEGER DEFAULT 0, `pv%dTicket` INTEGER DEFAULT 0, ", sz_Query, i, i, i, i, i, i, i, i, i, i, i);
format(sz_Query, sizeof(sz_Query), "%s`pv%dFuel` FLOAT DEFAULT 100.00, `pv%dImpound` INTEGER DEFAULT 0, `pv%dPlate` STRING DEFAULT NULL, `pv%dEZPass` INTEGER DEFAULT 0, `pv%dTicketReason` STRING DEFAULT NULL", sz_Query, i, i, i, i, i);
}
else
{
format(sz_Query, sizeof(sz_Query), "%s`pv%dPosX` FLOAT DEFAULT 0.0, `pv%dPosY` FLOAT DEFAULT 0.0, `pv%dPosZ` FLOAT DEFAULT 0.0, `pv%dPosAngle` FLOAT DEFAULT 0.0, `pv%dModelId` INTEGER DEFAULT 0, `pv%dLock` INTEGER DEFAULT 0, `pv%dLocked` INTEGER DEFAULT 0, `pv%dPaintJob` INTEGER DEFAULT 0, `pv%dColor1` INTEGER DEFAULT 0, `pv%dColor2` INTEGER DEFAULT 0, `pv%dTicket` INTEGER DEFAULT 0, ", sz_Query, i, i, i, i, i, i, i, i, i, i, i);
format(sz_Query, sizeof(sz_Query), "%s`pv%dFuel` FLOAT DEFAULT 100.00, `pv%dImpound` INTEGER DEFAULT 0, `pv%dPlate` STRING DEFAULT NULL, `pv%dEZPass` INTEGER DEFAULT 0, `pv%dTicketReason` STRING DEFAULT NULL, ", sz_Query, i, i, i, i, i);
}
}
format(sz_Query, sizeof(sz_Query), "%s)", sz_Query);
db_free_result(db_query(Database, sz_Query));
The error:
Код:
[20:15:57] [Warning] db_query: Query failed: near "0": syntax error [20:15:57] [Error] db_free_result(): invalid result handle 0