26.12.2015, 23:33
Hello and Merry Christmas,
I happen to have a problem where cars do not load properly ...
OnGameModeInit:
And finally the function ...
The result is this:
I happen to have a problem where cars do not load properly ...
OnGameModeInit:
Код:
mysql_tquery(mysql, "SELECT * FROM autos", "CargarAutos", "");
Код:
funcion:CargarAutos() { new index = 0; new rows = cache_get_row_count(); for (new i = 0; i != rows; i++) { if(i == 953) break; for(new slot = 1; slot != 4; slot++) vehTrunkCounter[i] = 0; jAutos[i][vModelo] = cache_get_field_content_int(i, "vModelo"); jAutos[i][vFaccion] = cache_get_field_content_int(i, "vFaccion"); jAutos[i][vPosX] = cache_get_field_content_float(i, "vPosX"); jAutos[i][vPosY] = cache_get_field_content_float(i, "vPosY"); 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][vComida] = cache_get_field_content_int(i, "vComida"); 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"); vehTrunk[i][1] = cache_get_field_content_int(i, "vArma1"); vehTrunk[i][2] = cache_get_field_content_int(i, "vArma2"); vehTrunk[i][3] = cache_get_field_content_int(i, "vArma3"); vehTrunkAmmo[i][1] = cache_get_field_content_int(i, "vBalas1"); vehTrunkAmmo[i][2] = cache_get_field_content_int(i, "vBalas2"); vehTrunkAmmo[i][3] = cache_get_field_content_int(i, "vBalas3"); vehTrunkArmour[i] = cache_get_field_content_float(i, "vChaleco"); 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], 0); IDCars[i] = true; if(vehTrunk[i][1] != 0) vehTrunkCounter[i]++, SlotsV[i]++; if(vehTrunk[i][2] != 0) vehTrunkCounter[i]++, SlotsV[i]++; if(vehTrunk[i][3] != 0) vehTrunkCounter[i]++, SlotsV[i]++; SetVehicleParamsEx(i, 0, 0, 0, 0, 0, 0, 0); SetVehicleHealth(i, 999.0); index++; } printf("Autos cargados: %i", index); return 1; }
![](http://i.imgur.com/20Cs9Bp.png)