-
Notifications
You must be signed in to change notification settings - Fork 3
Handling & model flags
dotSILENT edited this page Jan 16, 2019
·
2 revisions
Flag enum name | Integer value (hex) |
---|---|
HFLAG_1G_BOOST | 0x1 |
HFLAG_2G_BOOST | 0x2 |
HFLAG_NPC_ANTI_ROLL | 0x4 |
HFLAG_NPC_NEUTRAL_HANDL | 0x8 |
HFLAG_NO_HANDBRAKE | 0x10 |
HFLAG_STEER_REARWHEELS | 0x20 |
HFLAG_HB_REARWHEEL_STEER | 0x40 |
HFLAG_ALT_STEER_OPT | 0x80 |
HFLAG_WHEEL_F_NARROW2 | 0x100 |
HFLAG_WHEEL_F_NARROW | 0x200 |
HFLAG_WHEEL_F_WIDE | 0x400 |
HFLAG_WHEEL_F_WIDE2 | 0x800 |
HFLAG_WHEEL_R_NARROW2 | 0x1000 |
HFLAG_WHEEL_R_NARROW | 0x2000 |
HFLAG_WHEEL_R_WIDE | 0x4000 |
HFLAG_WHEEL_R_WIDE2 | 0x8000 |
HFLAG_HYDRAULIC_GEOM | 0x10000 |
HFLAG_HYDRAULIC_INST | 0x20000 |
HFLAG_HYDRAULIC_NONE | 0x40000 |
HFLAG_NOS_INST | 0x80000 |
HFLAG_OFFROAD_ABILITY | 0x100000 |
HFLAG_OFFROAD_ABILITY2 | 0x200000 |
HFLAG_HALOGEN_LIGHTS | 0x400000 |
HFLAG_PROC_REARWHEEL_1ST | 0x800000 |
HFLAG_USE_MAXSP_LIMIT | 0x1000000 |
HFLAG_LOW_RIDER | 0x2000000 |
HFLAG_STREET_RACER | 0x4000000 |
HFLAG_SWINGING_CHASSIS | 0x10000000 |
Flag enum name | Integer value (hex) |
---|---|
MFLAG_IS_VAN | 0x1 |
MFLAG_IS_BUS | 0x2 |
MFLAG_IS_LOW | 0x4 |
MFLAG_IS_BIG | 0x8 |
MFLAG_REVERSE_BONNET | 0x10 |
MFLAG_HANGING_BOOT | 0x20 |
MFLAG_TAILGATE_BOOT | 0x40 |
MFLAG_NOSWING_BOOT | 0x80 |
MFLAG_NO_DOORS | 0x100 |
MFLAG_TANDEM_SEATS | 0x200 |
MFLAG_SIT_IN_BOAT | 0x400 |
MFLAG_CONVERTIBLE | 0x800 |
MFLAG_NO_EXHAUST | 0x1000 |
MFLAG_DOUBLE_EXHAUST | 0x2000 |
MFLAG_NO1FPS_LOOK_BEHIND | 0x4000 |
MFLAG_FORCE_DOOR_CHECK | 0x8000 |
MFLAG_AXLE_F_NOTILT | 0x10000 |
MFLAG_AXLE_F_SOLID | 0x20000 |
MFLAG_AXLE_F_MCPHERSON | 0x40000 |
MFLAG_AXLE_F_REVERSE | 0x80000 |
MFLAG_AXLE_R_NOTILT | 0x100000 |
MFLAG_AXLE_R_SOLID | 0x200000 |
MFLAG_AXLE_R_MCPHERSON | 0x400000 |
MFLAG_AXLE_R_REVERSE | 0x800000 |
MFLAG_IS_BIKE | 0x1000000 |
MFLAG_IS_HELI | 0x2000000 |
MFLAG_IS_PLANE | 0x4000000 |
MFLAG_IS_BOAT | 0x8000000 |
MFLAG_BOUNCE_PANELS | 0x10000000 |
MFLAG_DOUBLE_RWHEELS | 0x20000000 |
MFLAG_FORCE_GROUND_CLEARANCE | 0x40000000 |
MFLAG_IS_HATCHBACK | 0x80000000 |
Handling flags are regular bit flags, there are 4 macros defined to help operating on them:
-
FLAG_IS_ENABLED(
flag_var
,flag
) - Checks if a certainflag
is enabled in theflag_var
variable -
FLAG_ENABLE(
flag_var
,flag
) - Enables aflag
in theflag_var
variable -
FLAG_DISABLE(
flag_var
,flag
) - Disables aflag
in theflag_var
variable -
FLAG_FLIP(
flag_var
,flag
) - "Flips" theflag
in theflag_var
variable, if it was enabled it will be disabled and vice versa
// disable the annoying 'swinging' of the body in Sabre
new flags;
GetModelHandlingInt(475, HANDL_HANDLINGFLAGS, flags);
FLAG_DISABLE(flags, HFLAG_SWINGING_CHASSIS);
SetModelHandlingInt(475, HANDL_HANDLINGFLAGS, flags); // the value needs to be set, FLAG_DISABLE only modified the value
// enable the bluish halogen lights if the vehicle has the DOUBLE_EXHAUST model flag
new flags, vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHandlingInt(vehicleid, HANDL_MODELFLAGS, flags);
if(FLAG_IS_ENABLED(flags, MFLAG_DOUBLE_EXHAUST))
{
GetVehicleHandlingInt(vehicleid, HANDL_HANDLINGFLAGS, flags);
FLAG_ENABLE(flags, HFLAG_HALOGEN_LIGHTS);
SetVehicleHandlingInt(vehicleid, HANDL_HANDLINGFLAGS, flags);
}
Some flags might not work for players that had the vehicle streamed in until they re-stream it. That's because some flags, such as HFLAG_SWINGING_CHASSIS
are set before the vehicle is actually created in-game.