05.11.2014, 14:47
Your problem is simply because you're not actually returning a vehicle id from the MySQL server. You've defined ID but not assigned any data.
So, everytime you're using ID the script is doing this:
Instead of whatever ID the vehicle is. Select everything from the Cars database and make sure to assign ID a value in a loop. I'm using MySQL R33 for this example, you should really upgrade as it's way faster. You'll get the jist of it anyways:
So, everytime you're using ID the script is doing this:
pawn Код:
MasinosI[0][x] = Pos[0];
MasinosI[0][y] = Pos[1];
MasinosI[0][z] = Pos[2];
MasinosI[0][a] = Pos[3];
pawn Код:
if(cache_num_rows() != 0) // Example of loading vehicles using MySQL R33. Forgot how R6 and under works.
{
for(new i = 0; i != cache_num_rows(); i++)
{
cache_get_field_content_int(i, "Value", MasinosI[i][Value]); // Fetching & Assigning Data
cache_get_field_content_int(i, "Value", MasinosI[i][Value]); // Fetching & Assigning Data
cache_get_field_content_int(i, "Value", MasinosI[i][Value]); // Fetching & Assigning Data
cache_get_field_content_int(i, "Value", MasinosI[i][Value]); // Fetching & Assigning Data
// Then go on to create the vehicle
}
}