22.01.2019, 09:36
Hi, the values I added in the iterator that I created appear to be empty. Can you help me?
Код:
new Iterator: BirlikArac[100]<10>; public OnGameModeInit() { Iter_Init(BirlikArac); mysql_tquery(g_SQL, "SELECT * FROM `birlikarac`", "BirlikAracYukle", ""); return 1; } fonksiyon-> BirlikAracYukle() { new rows; cache_get_row_count(rows); if(rows) { new sql, id, model, Float: vPos[4], vRenk[2], vPlaka[15], vfiyat, Float: vBenzin, Float: vKilometre, Float: vCan, vVergi, vVergi2, vSure, vTarih, vMod[17], vPaint, vehicleid, loader ; for(new i = 0; i < rows; ++i) { cache_get_value_name_int(i, "id", sql); cache_get_value_name_int(i, "birlikid", id); cache_get_value_name_int(i, "model", model); cache_get_value_name_float(i, "xx", vPos[0]); cache_get_value_name_float(i, "yy", vPos[1]); cache_get_value_name_float(i, "zz", vPos[2]); cache_get_value_name_float(i, "aa", vPos[3]); cache_get_value_name_int(i, "renk1", vRenk[0]); cache_get_value_name_int(i, "renk2", vRenk[1]); cache_get_value_name_int(i, "paintjob", vPaint); cache_get_value_name(i, "plaka", vPlaka, sizeof(vPlaka)); cache_get_value_name_int(i, "fiyat", vfiyat); cache_get_value_name_float(i, "benzin", vBenzin); cache_get_value_name_float(i, "kilometre", vKilometre); cache_get_value_name_float(i, "can", vCan); cache_get_value_name_int(i, "vergi", vVergi); cache_get_value_name_int(i, "vergi2", vVergi2); cache_get_value_name_int(i, "vergisure", vSure); cache_get_value_name_int(i, "tarih", vTarih); cache_get_value_name_int(i, "amod1", vMod[0]); cache_get_value_name_int(i, "amod2", vMod[1]); cache_get_value_name_int(i, "amod3", vMod[2]); cache_get_value_name_int(i, "amod4", vMod[3]); cache_get_value_name_int(i, "amod5", vMod[4]); cache_get_value_name_int(i, "amod6", vMod[5]); cache_get_value_name_int(i, "amod7", vMod[6]); cache_get_value_name_int(i, "amod8", vMod[7]); cache_get_value_name_int(i, "amod9", vMod[8]); cache_get_value_name_int(i, "amod10", vMod[9]); cache_get_value_name_int(i, "amod11", vMod[10]); cache_get_value_name_int(i, "amod12", vMod[11]); cache_get_value_name_int(i, "amod13", vMod[12]); cache_get_value_name_int(i, "amod14", vMod[13]); cache_get_value_name_int(i, "amod15", vMod[14]); cache_get_value_name_int(i, "amod16", vMod[15]); cache_get_value_name_int(i, "amod17", vMod[16]); vehicleid = CreateVehicle(model, vPos[0], vPos[1], vPos[2], vPos[3], vRenk[0], vRenk[1], -1); SetVehicleNumberPlate(vehicleid, vPlaka); BirlikAraclari[vehicleid][birlik_arac] = true; BirlikAraclari[vehicleid][sql_id] = sql; BirlikAraclari[vehicleid][birlik_id] = id; BirlikAraclari[vehicleid][birlik_pozisyon][0] = vPos[0]; BirlikAraclari[vehicleid][birlik_pozisyon][1] = vPos[1]; BirlikAraclari[vehicleid][birlik_pozisyon][2] = vPos[2]; BirlikAraclari[vehicleid][birlik_pozisyon][3] = vPos[3]; BirlikAraclari[vehicleid][birlik_renkler][0] = vRenk[0]; BirlikAraclari[vehicleid][birlik_renkler][1] = vRenk[1]; BirlikAraclari[vehicleid][birlik_Paintjob] = vPaint; format(BirlikAraclari[vehicleid][birlik_plaka], 15, vPlaka); BirlikAraclari[vehicleid][birlik_fiyat] = vfiyat; BirlikAraclari[vehicleid][birlik_benzin] = vBenzin; BirlikAraclari[vehicleid][birlik_kilometre] = vKilometre; BirlikAraclari[vehicleid][birlik_can] = vCan; BirlikAraclari[vehicleid][birlik_vergi] = vVergi; BirlikAraclari[vehicleid][birlik_vergi2] = vVergi2; BirlikAraclari[vehicleid][birlik_vergisure] = vSure; BirlikAraclari[vehicleid][birlik_tarih] = vTarih; ChangeVehicleColor(vehicleid, vRenk[0], vRenk[1]); ChangeVehiclePaintjob(vehicleid, vPaint - 1); for(new it = 0; it < 17; it++) { BirlikAraclari[vehicleid][birlik_mod][it] = vMod[it]; if(vMod[it] != 0) { AddVehicleComponent(vehicleid, vMod[it]); } } loader++; Iter_Add(BirlikArac[id], vehicleid); // This place doesn't work. foreach(new ix : BirlikArac[id]){ printf("vID: %d", ix); } } } return 1; }