Something with me and syntax errors... :P
#1

Fixed.
Reply
#2

pawn Код:
format(string, sizeof(string), "UPDATE `vehicles` SET `model` = %d, `park_x` = %f, `park_y` = %f, `park_z` = %f, `park_o` = %f, ", VehicleInfo[vehicleid][vModel],
    VehicleInfo[vehicleid][vPark_x], VehicleInfo[vehicleid][vPark_y], VehicleInfo[vehicleid][vPark_z], VehicleInfo[vehicleid][vPark_o], VehicleInfo[vehicleid][vSQLid]);

    format(string, sizeof(string), "`color1` = %d, `color2` = %d, `respawndelay` = %d, `ownable` = %f, `ownerid` = %d, `factionid` = %d, ",VehicleInfo[vehicleid][vCol1], VehicleInfo[vehicleid][vCol2], VehicleInfo[vehicleid][vRespawnDelay],
    VehicleInfo[vehicleid][vOwnable], VehicleInfo[vehicleid][vOwnerID], VehicleInfo[vehicleid][vFactionID], VehicleInfo[vehicleid][vSQLid]);

    format(string, sizeof(string), "`jobid` = %d, `engine` = %d, `fuel` = %d, `locked` = %d, `trunkopen` = %d, `hoodopen` = %d, `trunkinv1` = %d, ",
     string,VehicleInfo[vehicleid][vJobID], VehicleInfo[vehicleid][vEngine], VehicleInfo[vehicleid][vFuel], VehicleInfo[vehicleid][vLocked], VehicleInfo[vehicleid][vTrunkOpen], VehicleInfo[vehicleid][vHoodOpen], VehicleInfo[vehicleid][vTrunkInv1]);

    format(string, sizeof(string), "`trunkinv2` = %d, `trunkinv3` = %d, `trunkinv4` = %d, `trunkinv5` = %d, `trunkqnt1` = %d, `trunkqnt2` = %d, `trunkqnt3` = %d, ", VehicleInfo[vehicleid][vTrunkInv2], VehicleInfo[vehicleid][vTrunkInv3],
    VehicleInfo[vehicleid][vTrunkInv4], VehicleInfo[vehicleid][vTrunkInv5], VehicleInfo[vehicleid][vTrunkQnt1], VehicleInfo[vehicleid][vTrunkQnt2], VehicleInfo[vehicleid][vTrunkQnt3]);

     format(string, sizeof(string), "`trunkqnt4` = %d, `trunkqnt5` = %d, `price` = %d, `plate` = %s WHERE `SQLid` = %d", VehicleInfo[vehicleid][vTrunkQnt4], VehicleInfo[vehicleid][vTrunkQnt5], VehicleInfo[vehicleid][vPrice],
     VehicleInfo[vehicleid][vPlate], VehicleInfo[vehicleid][vSQLid]);
or

pawn Код:
format(string, sizeof(string), "UPDATE `vehicles` SET `model` = %d, `park_x` = %f, `park_y` = %f, `park_z` = %f, `park_o` = %f, ", VehicleInfo[vehicleid][vModel],
    VehicleInfo[vehicleid][vPark_x], VehicleInfo[vehicleid][vPark_y], VehicleInfo[vehicleid][vPark_z], VehicleInfo[vehicleid][vPark_o], VehicleInfo[vehicleid][vSQLid]);

    format(string, sizeof(string), "%s`color1` = %d, `color2` = %d, `respawndelay` = %d, `ownable` = %f, `ownerid` = %d, `factionid` = %d, ",string,VehicleInfo[vehicleid][vCol1], VehicleInfo[vehicleid][vCol2], VehicleInfo[vehicleid][vRespawnDelay],
    VehicleInfo[vehicleid][vOwnable], VehicleInfo[vehicleid][vOwnerID], VehicleInfo[vehicleid][vFactionID], VehicleInfo[vehicleid][vSQLid]);

    format(string, sizeof(string), "%s`jobid` = %d, `engine` = %d, `fuel` = %d, `locked` = %d, `trunkopen` = %d, `hoodopen` = %d, `trunkinv1` = %d, ",
     string,VehicleInfo[vehicleid][vJobID], VehicleInfo[vehicleid][vEngine], VehicleInfo[vehicleid][vFuel], VehicleInfo[vehicleid][vLocked], VehicleInfo[vehicleid][vTrunkOpen], VehicleInfo[vehicleid][vHoodOpen], VehicleInfo[vehicleid][vTrunkInv1]);

    format(string, sizeof(string), "%s`trunkinv2` = %d, `trunkinv3` = %d, `trunkinv4` = %d, `trunkinv5` = %d, `trunkqnt1` = %d, `trunkqnt2` = %d, `trunkqnt3` = %d, ",string, VehicleInfo[vehicleid][vTrunkInv2], VehicleInfo[vehicleid][vTrunkInv3],
    VehicleInfo[vehicleid][vTrunkInv4], VehicleInfo[vehicleid][vTrunkInv5], VehicleInfo[vehicleid][vTrunkQnt1], VehicleInfo[vehicleid][vTrunkQnt2], VehicleInfo[vehicleid][vTrunkQnt3]);

     format(string, sizeof(string), "%s`trunkqnt4` = %d, `trunkqnt5` = %d, `price` = %d, `plate` = %s WHERE `SQLid` = %d", string, VehicleInfo[vehicleid][vTrunkQnt4], VehicleInfo[vehicleid][vTrunkQnt5], VehicleInfo[vehicleid][vPrice],
     VehicleInfo[vehicleid][vPlate], VehicleInfo[vehicleid][vSQLid]);

try them, not sure
Reply
#3

Could you tell me what you changed, and what the problem was?
Reply
#4

format(string, sizeof(string), "%s

%d, ",string

Are used for when query is called, so not needed there.
Reply
#5

Yes, they are used when the query is called. How are they not needed there. Do you even understand my code?
Reply
#6

Quote:
Originally Posted by Antonio [G-RP]
Посмотреть сообщение
Yes, they are used when the query is called. How are they not needed there. Do you even understand my code?
Yes I do. You can't call a sting into a string, or even if you can, in this case, it has no sense.
Reply
#7

try this
http://notesbin.com/1336996749

i changed

Код:
`plate` = %s WHERE `SQLid` = %d"
to


Код:
`plate` = `%s` WHERE `SQLid` = %d"
Reply
#8

Quote:
Originally Posted by Kapil
Посмотреть сообщение
try this
http://notesbin.com/1336996749

i changed

Код:
`plate` = %s WHERE `SQLid` = %d"
to


Код:
`plate` = `%s` WHERE `SQLid` = %d"
What I did to fix it was change it to `plate` = '%s', so basicly, you were correct. Though, I did this a few hours ago. Thanks for the help, anyways.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)