Вот код:
{ mysql_function_query(connect_mysql, "SELECT * FROM `cars`", true, "@_LoadCars", ""); return true; }
@_LoadCars(); @_LoadCars() { new rows, fields; cache_get_data(rows, fields); for(new i; i != rows; i++) { car[i][cModel] = cache_get_field_content_int(i, "Model"); car[i][cX] = cache_get_field_content_float(i, "X"); car[i][cY] = cache_get_field_content_float(i, "Y"); car[i][cZ] = cache_get_field_content_float(i, "Z"); car[i][cZ] = cache_get_field_content_float(i, "A"); car[i][cHP] = cache_get_field_content_float(i, "HP"); car[i][cColor1] = cache_get_field_content_int(i, "Color1"); car[i][cColor2] = cache_get_field_content_int(i, "Color2"); car[i][cDmg1] = cache_get_field_content_int(i, "Dmg1"); car[i][cDmg2] = cache_get_field_content_int(i, "Dmg2"); car[i][cDmg3] = cache_get_field_content_int(i, "Dmg3"); car[i][cDmg4] = cache_get_field_content_int(i, "Dmg4"); car[i][cPrice] = cache_get_field_content_int(i, "Price"); car[i][cID] = cache_get_field_content_int(i, "ID"); car[i][cPaintjob] = cache_get_field_content_int(i, "Paintjob"); cache_get_field_content(i, "Name", car[i][cName], MAX_PLAYER_NAME+1); allcars++; allbuycars++; LoadInfoCar(i); } return true; }
stock LoadInfoCar(i) { car[i][cVeh] = CreateVehicle(car[i][cModel], car[i][cX], car[i][cY], car[i][cZ], car[i][cA], car[i][cColor2], car[i][cColor2], 0); UpdateVehicleDamageStatus(car[i][cVeh], car[i][cDmg1], car[i][cDmg2], car[i][cDmg3], car[i][cDmg4]); if(car[i][cPaintjob] > 0) { car[i][cPrice] = ModelPrice[car[i][cModel]-400]; static const fmt_str[] = "Автомобиль продается за %d$"; new str[sizeof(fmt_str)-2+11+1]; car[i][cTDPrice] = CreateDynamic3DTextLabel(str, COLOR_YELLOW, 0, 0, 0.6, 20.0, INVALID_PLAYER_ID, i, 0, -1, -1, -1, 100.0); } return true; }
enum cInfo { cVeh, cName[MAX_PLAYER_NAME+1], cID, Float:cX, Float:cY, Float:cZ, Float:cA, cModel, cClass, cColor1, cColor2, cDmg1, cDmg2, cDmg3, cDmg4, Float:cHP, cPrice, cPaintjob, Text3D:cTDPrice } // classes: economy, standart, comfort, sport (4) new car[MAX_VEHICLES][cInfo], allcars, allbuycars;
Но загрузки авто не происходит, хотелось бы узнать, почему (транспорт не спавнится)
https://pixs.ru/image/wR9Rw
Вот таблица