31.05.2015, 08:40
Try this:
PHP код:
public CargarAutos()
{
new iRows, iFields;
cache_get_data(iRows, iFields, Conecction);
if(iRows)
{
for(new i = 0; i < iRows; i++)
{
jAutos[i][vModelo] = cache_get_field_content_int(i, "vModelo");
jAutos[i][vPosX] = cache_get_field_content_float(i, "vPosX");
jAutos[i][vPosY] = cache_get_field_content_float(i, "vPosX");
jAutos[i][vPosZ] = cache_get_field_content_float(i, "vPosZ");
jAutos[i][vPosA] = cache_get_field_content_float(i, "vPosA");
jAutos[i][vColor1] = cache_get_field_content_int(i, "vColor1");
jAutos[i][vColor2] = cache_get_field_content_int(i, "vColor2");
jAutos[i][vRespawn] = cache_get_field_content_int(i, "vRespawn");
jAutos[i][vGasolina] = cache_get_field_content_int(i, "vGasolina");
jAutos[i][vMapa] = cache_get_field_content_int(i, "vMapa");
jAutos[i][vRadio] = cache_get_field_content_int(i, "vRadio");
jAutos[i][vBombas] = cache_get_field_content_int(i, "vBombas");
jAutos[i][vMedicinas] = cache_get_field_content_int(i, "vMedicinas");
jAutos[i][vBotiquines] = cache_get_field_content_int(i, "vBotiquines");
jAutos[i][vVendas] = cache_get_field_content_int(i, "vVendas");
jAutos[i][vBengalas] = cache_get_field_content_int(i, "vBengalas");
jAutos[i][vGanzuas] = cache_get_field_content_int(i, "vGanzuas");
jAutos[i][vDrogas] = cache_get_field_content_int(i, "vDrogas");
jAutos[i][vPalos] = cache_get_field_content_int(i, "vPalos");
jAutos[i][vFosforos] = cache_get_field_content_int(i, "vFosforos");
jAutos[i][vBaterias] = cache_get_field_content_int(i, "vBaterias");
jAutos[i][vAgua] = cache_get_field_content_int(i, "vAgua");
jAutos[i][vCarneFresca] = cache_get_field_content_int(i, "vCarneFresca");
jAutos[i][vLata] = cache_get_field_content_int(i, "vLata");
jAutos[i][vLataGasolina] = cache_get_field_content_int(i, "vLataGasolina");
jAutos[i][vChaleco] = cache_get_field_content_float(i, "vChaleco");
jAutos[i][vArma1] = cache_get_field_content_int(i, "vArma1");
jAutos[i][vArma2] = cache_get_field_content_int(i, "vArma2");
jAutos[i][vArma3] = cache_get_field_content_int(i, "vArma3");
jAutos[i][vBalas1] = cache_get_field_content_int(i, "vBalas1");
jAutos[i][vBalas2] = cache_get_field_content_int(i, "vBalas2");
jAutos[i][vBalas3] = cache_get_field_content_int(i, "vBalas3");
jAutos[i][vID] = CreateVehicle(jAutos[i][vModelo], jAutos[i][vPosX], jAutos[i][vPosY], jAutos[i][vPosZ], jAutos[i][vPosA], jAutos[i][vColor1], jAutos[i][vColor2], jAutos[i][vRespawn]);
IDCars[i] = true;
jAutos[i][vAviso] = jAutos[i][vAviso2] = jAutos[i][vAviso3] = jAutos[i][vAviso4] = jAutos[i][vAviso5] = 0;
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(i, engine, lights, alarm, doors, bonnet, boot, objective)
SetVehicleParamsEx(i,0,lights,alarm,doors,bonnet,boot,objective);
for(new slot = 1; slot != 4; slot++)
vehTrunkCounter[i]=0;
NumbersCars++;
}
}
printf("Autos cargados: %d", NumbersCars);
return 1;
}
stock CargarTodoAuto()
{
print("Cargando autos...");
mysql_tquery(Conecction, "SELECT * FROM `autos`", "CargarAutos");
return 1;
}