[MySQL] Dealership Problem - 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] Dealership Problem (
/showthread.php?tid=595666)
[MySQL] Dealership Problem -
D0WN3D - 06.12.2015
So I copyed this DS
https://www.youtube.com/watch?v=1sETwYLz3cw to my GM.
It works perfect. Commands + system. But when I use /buyvehicle it dosen't load any vehicle from database.
So it shows me only the DS textdraws. On the original GM rg3 it works perfectly and load the DS Cars.
But on my GM it doesnt load anything.
Here are the codes:
Код:
function LoadDSVeh()
{
dsvehs = cache_num_rows();
for(new i = 1; i <= dsvehs; i++)
{
new j = i - 1;
DSModels[i][dID] = i;
DSModels[i][dModel] = cache_get_field_content_int(j, "Model");
DSModels[i][dPrice] = cache_get_field_content_int(j, "Price");
DSModels[i][dStock] = cache_get_field_content_int(j, "Stock");
DSModels[i][dDoors] = cache_get_field_content_int(j, "Doors");
cache_get_field_content(j, "Type", DSModels[i][dType], SQL, 129);
DSModels[i][dMaxSpeed] = cache_get_field_content_int(j, "MaxSpeed");
}
printf("[MYSQL] Dealership Vehicles: %d", dsvehs);
}
Код:
function LoadSystems()
{
new query[128];
mysql_format(SQL, query, sizeof(query), "SELECT * FROM `dsveh`");
mysql_tquery(SQL, query, "LoadDSVeh", "");
}
Re: [MySQL] Dealership Problem -
D0WN3D - 06.12.2015
Plzz Helpp
Re: [MySQL] Dealership Problem -
MartinSwag - 06.12.2015
Why do you use j?
Try this:
Код:
function LoadDSVeh()
{
dsvehs = cache_num_rows();
for(new i = 1; i <= dsvehs; i++)
{
DSModels[i][dID] = i;
DSModels[i][dModel] = cache_get_field_content_int(i, "Model");
DSModels[i][dPrice] = cache_get_field_content_int(i, "Price");
DSModels[i][dStock] = cache_get_field_content_int(i, "Stock");
DSModels[i][dDoors] = cache_get_field_content_int(i, "Doors");
cache_get_field_content(i, "Type", DSModels[i][dType], SQL, 129);
DSModels[i][dMaxSpeed] = cache_get_field_content_int(i, "MaxSpeed");
}
printf("[MYSQL] Dealership Vehicles: %d", dsvehs);
}
Re: [MySQL] Dealership Problem -
D0WN3D - 06.12.2015
Still not loading any car
http://s18.postimg.org/99jzh8u21/Untitled.png
Re: [MySQL] Dealership Problem -
MartinSwag - 06.12.2015
Quote:
Originally Posted by D0WN3D
|
What did the printf print in the console?
Re: [MySQL] Dealership Problem -
D0WN3D - 06.12.2015
It didn't printed the message. Idk why.
Re: [MySQL] Dealership Problem -
D0WN3D - 06.12.2015
I use MySQL R34
Re: [MySQL] Dealership Problem -
D0WN3D - 06.12.2015
UP++
Re: [MySQL] Dealership Problem -
D0WN3D - 06.12.2015
any ideas??
Re: [MySQL] Dealership Problem -
D0WN3D - 09.12.2015
Upp+