15.04.2012, 12:00
Alright, i want to load the components from database but i don't know why it gives me wrong numbers.
For each mod component i told him to show the id from the car and component id but it says: vehid: number(this works ok) comp: here it send 48, 46 only.
Here is the code.
For each mod component i told him to show the id from the car and component id but it says: vehid: number(this works ok) comp: here it send 48, 46 only.
Here is the code.
pawn Код:
mysql_fetch_field_row(vmod[0], "mod1"); mysql_fetch_field_row(vmod[1], "mod2"); mysql_fetch_field_row(vmod[2], "mod3"); mysql_fetch_field_row(vmod[3], "mod4");
mysql_fetch_field_row(vmod[4], "mod5"); mysql_fetch_field_row(vmod[5], "mod6"); mysql_fetch_field_row(vmod[6], "mod7"); mysql_fetch_field_row(vmod[7], "mod8");
mysql_fetch_field_row(vmod[8], "mod9"); mysql_fetch_field_row(vmod[9], "mod10"); mysql_fetch_field_row(vmod[10], "mod11"); mysql_fetch_field_row(vmod[11], "mod12");
car = AddStaticVehicle(strval(modelid), floatstr(x), floatstr(y), floatstr(z), floatstr(a), strval(color1), strval(color2));
SetVehicleNumberPlate(car, plate);
total_private_vehicles[car]++;
vmods[car][0] = vmod[0]; vmods[car][1] = vmod[1]; vmods[car][2] = vmod[2]; vmods[car][3] = vmod[3]; vmods[car][4] = vmod[4];
vmods[car][5] = vmod[5]; vmods[car][6] = vmod[6]; vmods[car][7] = vmod[7]; vmods[car][8] = vmod[8]; vmods[car][9] = vmod[9];
vmods[car][10] = vmod[10]; vmods[car][11] = vmod[11];
for(new i = 0; i < MAX_VEH_MODS; ++i)
{
if(vmods[car][i] > 0)
{
AddVehicleComponent(car, vmods[car][i]);
new string[126];
format(string, sizeof(string), "VehID: %i , comp: %i", car, vmods[car][i]);
SendClientMessage(playerid, -1, string);
}
}