CVehicle.p(235 -- 239) : error 008: must be a constant expression; assumed zero
#1

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")
    }
);
what is wrong with this code?

EDIT:
you can only use constants in { } brackets when initializing array.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)