Selecting data - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Selecting data (
/showthread.php?tid=201175)
Selecting data -
ajwar - 20.12.2010
Hi again, i want to select vehicle's information OnPlayerEnterVehicle. I have a stock wich is not working correctly, becouse vInfo[vehicleid][Id] returns = 0 or 1 becouse it's just 2 vehicles. What should i use to select current vehicle's Id? In DB Id is 277 and 278. Should i add something when i LoadVehicles? Or maybe you can suggest any other suggestions? Maybe i should first get Id with Fetch_field_row?
pawn Код:
stock GetCarSetting(vehicleid)
{
new Query[256];
format(Query, sizeof(Query), "SELECT * FROM vehicles WHERE ID= %d", vInfo[vehicleid][Id]);
mysql_query(Query); // Querys the "Query" Variable.
mysql_store_result(); // Stores the result from Query
if(mysql_num_rows()) // Checks if theres anyrow.
if(mysql_fetch_row_format(Query,"|"))
{
sscanf(Query, "p<|>e<ds[25]dffffdddddddddddddddddddds[20]s[20]>",vInfo[vehicleid]);
}
}
Re: Selecting data -
ajwar - 20.12.2010
anyone can help?