24.11.2013, 21:02
(
Последний раз редактировалось theYiin; 09.11.2014 в 17:49.
)
pawn Код:
// CVehicle.p(235 -- 239) : error 008: must be a constant expression; assumed zero
VEHICLE::Create(model, pos[xyz_Angle], color[2])
{
static idx;
if((idx = VEHICLE::GetFreeIDX()) != INVALID_VEHICLE_ID)
{
Vehicle[idx][VEHICLE::Model] = model;
Vehicle[idx][VEHICLE::Position] = pos;
Vehicle[idx][VEHICLE::Color] = color;
}
}
// somewhere in random function:
VEHICLE::Create // 235
(
SQL::get_field_assoc_int(r, "model"),
{
SQL::get_field_assoc_float(r, "x"), // 239
SQL::get_field_assoc_float(r, "y"),
SQL::get_field_assoc_float(r, "z")
},
{
SQL::get_field_assoc_int(r, "color_0"),
SQL::get_field_assoc_int(r, "color_1")
}
);
EDIT:
you can only use constants in { } brackets when initializing array.