30.05.2015, 08:07
This code no create vehicles...
Help...
Quote:
public CargarAutos() { new qwerty[128]; new i = 1, iRows, iFields, NumbersCars; cache_get_data(iRows, iFields, Conecction); while(i < iRows) { cache_get_field_content(i, "vModelo", qwerty, Conecction); jAutos[i][vModelo] = strval(qwerty); cache_get_field_content(i, "vPosX", qwerty, Conecction); jAutos[i][vPosX] = floatstr(qwerty); cache_get_field_content(i, "vPosX", qwerty, Conecction);jAutos[i][vPosY] = floatstr(qwerty); cache_get_field_content(i, "vPosZ", qwerty, Conecction); jAutos[i][vPosZ] = floatstr(qwerty); cache_get_field_content(i, "vPosA", qwerty, Conecction); jAutos[i][vPosA] = floatstr(qwerty); cache_get_field_content(i, "vColor1", qwerty, Conecction); jAutos[i][vColor1] = strval(qwerty); cache_get_field_content(i, "vColor2", qwerty, Conecction); jAutos[i][vColor2] = strval(qwerty); cache_get_field_content(i, "vRespawn", qwerty, Conecction); jAutos[i][vRespawn] = strval(qwerty); cache_get_field_content(i, "vGasolina", qwerty, Conecction); jAutos[i][vGasolina] = strval(qwerty); cache_get_field_content(i, "vMapa", qwerty, Conecction); jAutos[i][vMapa] = strval(qwerty); cache_get_field_content(i, "vRadio", qwerty, Conecction); jAutos[i][vRadio] = strval(qwerty); cache_get_field_content(i, "vBombas", qwerty, Conecction); jAutos[i][vBombas] = strval(qwerty); cache_get_field_content(i, "vMedicinas", qwerty, Conecction); jAutos[i][vMedicinas] = strval(qwerty); cache_get_field_content(i, "vBotiquines", qwerty, Conecction); jAutos[i][vBotiquines] = strval(qwerty); cache_get_field_content(i, "vVendas", qwerty, Conecction); jAutos[i][vVendas] = strval(qwerty); cache_get_field_content(i, "vBengalas", qwerty, Conecction); jAutos[i][vBengalas] = strval(qwerty); cache_get_field_content(i, "vGanzuas", qwerty, Conecction); jAutos[i][vGanzuas] = strval(qwerty); cache_get_field_content(i, "vDrogas", qwerty, Conecction); jAutos[i][vDrogas] = strval(qwerty); cache_get_field_content(i, "vPalos", qwerty, Conecction); jAutos[i][vPalos] = strval(qwerty); cache_get_field_content(i, "vFosforos", qwerty, Conecction); jAutos[i][vFosforos] = strval(qwerty); cache_get_field_content(i, "vBaterias", qwerty, Conecction); jAutos[i][vBaterias] = strval(qwerty); cache_get_field_content(i, "vAgua", qwerty, Conecction); jAutos[i][vAgua] = strval(qwerty); cache_get_field_content(i, "vCarneFresca", qwerty, Conecction); jAutos[i][vCarneFresca] = strval(qwerty); cache_get_field_content(i, "vLata", qwerty, Conecction); jAutos[i][vLata] = strval(qwerty); cache_get_field_content(i, "vLataGasolina", qwerty, Conecction); jAutos[i][vLataGasolina] = strval(qwerty); cache_get_field_content(i, "vChaleco", qwerty, Conecction); vehTrunkArmour[i] = floatstr(qwerty); cache_get_field_content(i, "vArma1", qwerty, Conecction); vehTrunk[i][1] = strval(qwerty); cache_get_field_content(i, "vArma2", qwerty, Conecction); vehTrunk[i][2] = strval(qwerty); cache_get_field_content(i, "vArma3", qwerty, Conecction); vehTrunk[i][3] = strval(qwerty); cache_get_field_content(i, "vBalas1", qwerty, Conecction); vehTrunkAmmo[i][1] = strval(qwerty); cache_get_field_content(i, "vBalas2", qwerty, Conecction); vehTrunkAmmo[i][2] = strval(qwerty); cache_get_field_content(i, "vBalas3", qwerty, Conecction); vehTrunkAmmo[i][3] = strval(qwerty); i = GetFreeVehicleSlot(); 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; jAutos[i][vAviso] = 0; jAutos[i][vAviso2] = 0; jAutos[i][vAviso3] = 0; jAutos[i][vAviso4] = 0; jAutos[i][vAviso5] = 0; new lights,alarm,doors,bonnet,boot,objective; SetVehicleParamsEx(i,0,lights,alarm,doors,bonnet,b oot,objective); i++; for(new slot = 1; slot != 4; slot++) { vehTrunkCounter[i]=0; } NumbersCars = i; } printf("Autos cargados: %d", NumbersCars); return 1; } stock CargarTodoAuto() { print("Cargando autos..."); mysql_function_query(Conecction, "SELECT * FROM `autos`", false, "CargarAutos", ""); return 1; } |