28.08.2016, 00:41
Hello, I am doing a MySQL Vehicle System. I have a trouble loading the cars, this code only load the first row from my table, currently I have three vehicles instead.
In my server.cfg it shows printed:
And should be:
Thanks a lot!
Код:
for (new i = 1; i < num_rows; i++) { new cosa[300]; format(cosa, sizeof(cosa), "ID: %d | Rows: %d", i, num_rows); printf(cosa); cache_get_field_content(i, "CarID", data), VehicleSystem[i][CarID] = strval(data); cache_get_field_content(i, "Model", data), VehicleSystem[i][Model]=strval(data); cache_get_field_content(i, "Locked", data), VehicleSystem[i][Locked]=strval(data); cache_get_field_content(i, "CarX", data), VehicleSystem[i][Carx]=strval(data); cache_get_field_content(i, "CarY", data), VehicleSystem[i][Cary]=strval(data); cache_get_field_content(i, "CarZ", data), VehicleSystem[i][Carz]=strval(data); cache_get_field_content(i, "CarA", data), VehicleSystem[i][Cara]=strval(data); cache_get_field_content(i, "Color1", data), VehicleSystem[i][Color1]=strval(data); cache_get_field_content(i, "Color2", data), VehicleSystem[i][Color2]=strval(data); cache_get_field_content(i, "Price", data), VehicleSystem[i][Price]=strval(data); cache_get_field_content(i, "Sell", data), VehicleSystem[i][Sell]=strval(data); cache_get_field_content(i, "Owner", data2), strmid(VehicleSystem[i][Owner],data2,0,30,30); new carr = CreateVehicle(VehicleSystem[i][Model],VehicleSystem[i][Carx],VehicleSystem[i][Cary],VehicleSystem[i][Carz]+5,VehicleSystem[i][Cara],VehicleSystem[i][Color1],VehicleSystem[i][Color2],600000); }
Код:
ID: 1 | Rows: 3
Код:
ID: 1 | Rows: 3 ID: 2 | Rows: 3 ID: 3 | Rows: 3