Not working - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Not working (
/showthread.php?tid=612498)
Not working -
GoldenLion - 18.07.2016
Hi, I need help with the "View Vehicle" in MDC 3rd time already today. The problem now is that if I run a random license plate that doesn't exists then it still runs the query and says that vehicle was not found in the database. It's not even supposed to run the query, I haven't made it work like that. Also if I even run a valid license plate, it says that vehicle was not found in the database. I don't understand what am I doing wrong:
Code:
Код:
removed, I don't want to release it :P
Re: Not working -
Sjn - 18.07.2016
Код:
format(query, sizeof(query), "SELECT `Character` FROM `characters` WHERE `ID` = '%d'", CarData[i][carOwner]);
carOwner is a string I suppose? If so, you need to use %e specifier in the query format.
Re: Not working -
GoldenLion - 18.07.2016
Nope, carOwner is an integer. Each player has got a SQL ID.
I fixed the problem by checking if the vehicle is owned before running the query.
Also I added a "count" variable.