Mysql r35 help! - 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: Mysql r35 help! (
/showthread.php?tid=489941)
Mysql r35 help! -
XxsenchixX - 24.01.2014
Hello guys , i want to ask a question about MySQL R35 or lower versions (r7+), i have vehicle system on r6 and older i need to convert that to r35
pawn Код:
stock LoadVehicles()
{
new Query[255], id;
format(Query, sizeof(Query), "SELECT * FROM vehicles");
mysql_query(Query);
mysql_store_result();
while(mysql_fetch_row(Query,"|"))
{
id = LoadedInfo[Vehicles];
sscanf(Query, "p<|>e<is[25]iiffff>", VehicleInfo[id]);
new Color1 = random(126); new Color2 = random(126);
CreateVehicle(VehicleInfo[id][Model],VehicleInfo[id][Pos][X],VehicleInfo[id][Pos][Y],VehicleInfo[id][Pos][Z],VehicleInfo[id][Pos][R],Color1,Color2, 60*10000);
LoadedInfo[Vehicles] = LoadedInfo[Vehicles] + 1;
}
}
What is the functions of mysql r35 ( instead of mysql_fetch_row , mysql_store_result)..
Thanks!
And here is my vehicle enum (if needed)
pawn Код:
enum vInfo
{
Id,
Owner[25],
Model,
Price,
Float:cx,
Float:cy,
Float:cz,
Float:cr
}
new VehicleInfo[MAX_VEHICLES][vInfo];
Re: Mysql r35 help! - HuSs3n - 24.01.2014
https://sampforum.blast.hk/showthread.php?tid=337810
Re: Mysql r35 help! -
XxsenchixX - 24.01.2014
If you don't know don't post please , i saw that tutorial and i can't convert that's why i came here asking for help not for links..
Re: Mysql r35 help! -
iZN - 24.01.2014
Check the wiki for the latest natives and their examples:
https://sampwiki.blast.hk/wiki/MySQL/R33 (This is updated for R35 recently by maddinat0r)
pawn Код:
// This is just an example.
stock LoadVehicles()
{
// Edit the 1 to your connection handle.
mysql_tquery(1, "SELECT * FROM vehicles", "LoadVehicleMySQL");
}
forward public LoadVehicleMySQL;
public LoadVehicleMySQL()
{
for(new yy=0; yy < cache_get_row_count(); ++yy)
{
cache_get_row(yy, 0, VehicleInfo[id][Model]);
cache_get_row_float(yy, 1, VehicleInfo[id][Pos][X]);
cache_get_row_float(yy, 2, VehicleInfo[id][Pos][Y]);
// This isn't completed yet, now do the rest.
}
return true;
}
Re: Mysql r35 help! -
XxsenchixX - 24.01.2014
Thank you so much iZN!
Re: Mysql r35 help! -
XxsenchixX - 24.01.2014
Still not working anyways thanks IZN , any more help guys?
Re: Mysql r35 help! - HuSs3n - 24.01.2014
sir , he just gave you an example , you need to modify the code to fit your needs and you cannot do that without understanding the tutorial.