@_LoadCars();
@_LoadCars()
{
new
rows,
fields;
cache_get_data(rows, fields);
new veh_id, veh_model, Float:veh_x, Float:veh_y, Float:veh_z, Float:veh_a, Float:veh_hp, veh_color1, veh_color2, veh_dmg1, veh_dmg2, veh_dmg3, veh_dmg4,
veh_price, veh_paintjob, veh_class, veh_name[MAX_PLAYER_NAME+1];
for(new i; i < rows; i++)
{
veh_model = cache_get_field_content_int(i, "Model");
veh_x = cache_get_field_content_float(i, "X");
veh_y = cache_get_field_content_float(i, "Y");
veh_z = cache_get_field_content_float(i, "Z");
veh_a = cache_get_field_content_float(i, "A");
veh_hp = cache_get_field_content_float(i, "HP");
veh_color1 = cache_get_field_content_int(i, "Color1");
veh_color2 = cache_get_field_content_int(i, "Color2");
veh_dmg1 = cache_get_field_content_int(i, "Dmg1");
veh_dmg2 = cache_get_field_content_int(i, "Dmg2");
veh_dmg3 = cache_get_field_content_int(i, "Dmg3");
veh_dmg4 = cache_get_field_content_int(i, "Dmg4");
veh_price = cache_get_field_content_int(i, "Price");
veh_paintjob = cache_get_field_content_int(i, "Paintjob");
veh_class = cache_get_field_content_int(i, "Class");
veh_id = cache_get_field_content_int(i, "ID");
cache_get_field_content(i, "Name", veh_name, MAX_PLAYER_NAME+1);
veh_id
= CreateVehicle(veh_model
, veh_x
, veh_y
, veh_z
, veh_a
, veh_color1
, veh_color2
, 0); if(veh_id == INVALID_VEHICLE_ID) return i--;
else if(veh_id != INVALID_VEHICLE_ID) continue;
if(veh_paintjob > 0)
ChangeVehiclePaintjob(veh_id
, veh_paintjob
-1); // 1, 2, 3 - нумерация винилов по порядку, 4 - отсутствие винил {
veh_price = ModelPrice[veh_model-400];
static
fmt_str[] = "Автомобиль продается за %d$";
new
str[sizeof(fmt_str)-2+11+1];
format(str
, sizeof(str
), fmt_str
, veh_price
); CreateDynamic3DTextLabel(str, COLOR_YELLOW, 0, 0, 0.6, 20.0, INVALID_PLAYER_ID, i, 0, -1, -1, -1, 100.0);
}
allvehs++;
allbuyvehs++;
veh[veh_id][vModel] = veh_model;
veh[veh_id][vX] = veh_x;
veh[veh_id][vY] = veh_y;
veh[veh_id][vZ] = veh_z;
veh[veh_id][vA] = veh_a;
veh[veh_id][vHP] = veh_hp;
veh[veh_id][vColor1] = veh_color1;
veh[veh_id][vColor2] = veh_color2;
veh[veh_id][vDmg1] = veh_dmg1;
veh[veh_id][vDmg2] = veh_dmg2;
veh[veh_id][vDmg3] = veh_dmg3;
veh[veh_id][vDmg4] = veh_dmg4;
veh[veh_id][vPrice] = veh_price;
veh[veh_id][vPaintjob] = veh_paintjob;
veh[veh_id][vClass] = veh_class;
veh[veh_id][vID] = i;
cache_get_field_content(i, "Name", veh[veh_id][vName], MAX_PLAYER_NAME+1);
}
return true;
}