Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(extra-natives/five) GET_VEHICLE_HAS_FLAG #2340

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions code/components/extra-natives-five/src/VehicleExtraNatives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ static int VisualHeightSetOffset = 0x07C;
static int LightMultiplierGetOffset;
static int VehiclePitchBiasOffset;
static int VehicleRollBiasOffset;
static int VehicleFlagsOffset;

// TODO: Wheel class.
static int WheelYRotOffset = 0x008;
Expand Down Expand Up @@ -621,6 +622,11 @@ static HookFunction initFunction([]()
VehicleRollBiasOffset = VehiclePitchBiasOffset - 4;
}

{
auto location = hook::get_pattern<char>("48 85 C0 74 3C 8B 80 ? ? ? ? C1 E8 0F");
VehicleFlagsOffset = *(uint32_t*)(location + 7);
}

{
std::initializer_list<PatternPair> list = {
{ "44 38 ? ? ? ? 02 74 ? F3 0F 10 1D", 13 },
Expand Down Expand Up @@ -1155,6 +1161,20 @@ static HookFunction initFunction([]()
}
});

fx::ScriptEngine::RegisterNativeHandler("GET_VEHICLE_HAS_FLAG", [](fx::ScriptContext& context)
{
int flagIndex = context.GetArgument<int>(1);

if (flagIndex < 0 || flagIndex >= (32 * 7)) return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We prefer to use brackets even for single-line returns like that. It should be something like this:

if (flagIndex < 0 || flagIndex >= (32 * 7))
{
    return;
}

While I assume it's ~okay to keep a hardcoded max index flag for now (we're far from any out-of-bounds issues as of now), how difficult do you think it would be for you to get the number of flags directly from rage's parser? I could implement this myself later if you feel uncomfortable about changing the way it works in this PR.


if (fwEntity* vehicle = getAndCheckVehicle(context, "GET_VEHICLE_HAS_FLAG"))
{
auto addr = *reinterpret_cast<uint64_t *>((unsigned char *)vehicle + 0x020);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion:

auto modelInfo = *reinterpret_cast<uint64_t*>((char*)vehicle + 0x20);

auto target_block = *(uint32_t*)(addr + VehicleFlagsOffset + sizeof(uint32_t) * (flagIndex / 32));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable names should be in camelCase:

auto targetBlock = *(uint32_t*)(modelInfo + VehicleFlagsOffset + sizeof(uint32_t) * (flagIndex / 32));

context.SetResult<bool>((target_block & (1 << (flagIndex & 31))) != 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context.SetResult<bool>((targetBlock & (1 << (flagIndex & 31))) != 0);

}
});

fx::ScriptEngine::RegisterNativeHandler("IS_VEHICLE_WANTED", std::bind(readVehicleMemoryBit<&IsWantedOffset, 3>, _1, "IS_VEHICLE_WANTED"));

fx::ScriptEngine::RegisterNativeHandler("IS_VEHICLE_PREVIOUSLY_OWNED_BY_PLAYER", std::bind(readVehicleMemoryBit<&PreviouslyOwnedByPlayerOffset, 1>, _1, "IS_VEHICLE_PREVIOUSLY_OWNED_BY_PLAYER"));
Expand Down
21 changes: 21 additions & 0 deletions ext/native-decls/GetVehicleHasFlag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
ns: CFX
apiset: client
---
## GET_VEHICLE_HAS_FLAG

```c
bool GET_VEHICLE_HAS_FLAG(Vehicle vehicle, int flagIndex);
```

Get vehicle.meta flag by index. Useful examples include FLAG_LAW_ENFORCEMENT (31), FLAG_RICH_CAR (36), FLAG_IS_ELECTRIC (43), FLAG_IS_OFFROAD_VEHICLE (48).

Complete list of flags: https://gtamods.com/wiki/Vehicles.meta#flags
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we're okay with using any 3rd party resources in our docs, these links might die at any time, unfortunately.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if you're interested in using things from the leaked source, but here is a list I generated. Most of the descriptions come from the source, though I went through and manually edited most and added some descriptions where the source didn't have any. Haven't compared it to the GTAMods wiki, so not sure if it's missing details.

Value Description
FLAG_SMALL_WORKER This vehicle is a small worker (forklift, luggage handler) and should only be placed on specific paths.
FLAG_BIG This vehicle is very big and should avoid turning.
FLAG_NO_BOOT This vehicle should not be considered for boot inventory.
FLAG_ONLY_DURING_OFFICE_HOURS This vehicle should only be spawned in during office hours.
FLAG_BOOT_IN_FRONT This car has the boot in front so the boot searches should be from front.
FLAG_IS_VAN This vehicle is a van, the rear doors open sideways.
FLAG_AVOID_TURNS This vehicle is trying to avoid turning. Go straight where possible.
FLAG_HAS_LIVERY This vehicle has liveries, some texture will be swapped upon instancing.
FLAG_LIVERY_MATCH_EXTRA This vehicle texture swap will match the part swap. Ex. using livery 1 enables extra_1.
FLAG_SPORTS Sports car.
FLAG_DELIVERY Can be used for deliveries (vans and small trucks).
FLAG_NOAMBIENTOCCLUSION Vehicle doesn't have ambient occlusion rendered.
FLAG_ONLY_ON_HIGHWAYS This vehicle can only be created on highways (like a tourbus).
FLAG_TALL_SHIP This is a tall ship and should not be placed on nodes with LowBridge ticked.
FLAG_SPAWN_ON_TRAILER If set for a trailer it enables other cars to spawn on it. If set for normal vehicle it enabled it to spawn on a trailer.
FLAG_SPAWN_BOAT_ON_TRAILER If set for a trailer it enables a boat to spawn on it. If set for boats it enables them to spawn on a trailer.
FLAG_EXTRAS_GANG If ped spawning with car is a gang member enable extras 5-8 otherwise enable randomly.
FLAG_EXTRAS_CONVERTIBLE Vehicle has a convertible roof. If the roof is up, extras 2-4 may be active. If down, only extra 1 may be active.
FLAG_EXTRAS_TAXI Must have a taxi light, one of 5,6,7,8.
FLAG_EXTRAS_RARE Lower the chance extras being enabled.
FLAG_EXTRAS_REQUIRE The vehicle will spawn with at least 1 extra enabled.
FLAG_EXTRAS_STRONG Extras won't break off.
FLAG_EXTRAS_ONLY_BREAK_WHEN_DESTROYED Extras won't break off until the vehicle is blown up.
FLAG_EXTRAS_SCRIPT Extras 5-8 can only be enabled by script. If vehicle is a plane, only extra 7 is restricted. If vehicle is a helicopter, only extras 10-12 are restricted.
FLAG_EXTRAS_ALL All suitable extras should be turned on (e.g. all non-gang extras if non gang car).
FLAG_EXTRAS_MATCH_LIVERY Uses the livery with same index as the extra (e.g. extra_1 forces livery 1)
FLAG_DONT_ROTATE_TAIL_ROTOR This vehicle should not have a rotated tail rotor.
FLAG_PARKING_SENSORS This vehicle has parking sensors.
FLAG_PEDS_CAN_STAND_ON_TOP Peds can stand on top of this vehicle.
FLAG_TAILGATE_TYPE_BOOT This vehicle has a tailgate type boot (it opens down and back).
FLAG_GEN_NAVMESH This vehicle should generate a nav mesh. This allows peds to navigate on top (used for boats, trailers).
FLAG_LAW_ENFORCEMENT Law enforcement vehicle.
FLAG_EMERGENCY_SERVICE Is a emergency service vehicle.
FLAG_DRIVER_NO_DRIVE_BY Driver of this vehicle can't do drive-bys.
FLAG_NO_RESPRAY Vehicle is not allowed to be resprayed at garages.
FLAG_IGNORE_ON_SIDE_CHECK Vehicle can be entered if its on its side.
FLAG_RICH_CAR Rich car, indicates what peds can be used as drivers.
FLAG_AVERAGE_CAR Average car, indicates what peds can be used as drivers.
FLAG_POOR_CAR Poor car, indicates what peds can be used as drivers.
FLAG_ALLOWS_RAPPEL This vehicle allows people to rappel out of it.
FLAG_DONT_CLOSE_DOOR_UPON_EXIT Vehicle prevents peds from closing door when exiting.
FLAG_USE_HIGHER_DOOR_TORQUE Make the doors open/close faster.
FLAG_DISABLE_THROUGH_WINDSCREEN Prevent peds in this vehicle from being thrown from windscreen.
FLAG_IS_ELECTRIC Vehicle doesn't have a petrol tank.
FLAG_NO_BROKEN_DOWN_SCENARIO Explicitly disable broken down car scenarios on this vehicle.
FLAG_IS_JETSKI This vehicle is a jetski.
FLAG_DAMPEN_STICKBOMB_DAMAGE Whether or not we should dampen the total damage of attached stickybombs.
FLAG_DONT_SPAWN_IN_CARGEN Stops the vehicle from being spawned by cargens (i.e. parked).
FLAG_IS_OFFROAD_VEHICLE Flags the vehicles as an offroad only vehicle.
FLAG_INCREASE_PED_COMMENTS Peds will have a bigger probability of commenting on this vehicle.
FLAG_EXPLODE_ON_CONTACT Whether or not a bullet/projectile will force the vehicle to explode.
FLAG_USE_FAT_INTERIOR_LIGHT Vehicle needs a bigger interior light.
FLAG_HEADLIGHTS_USE_ACTUAL_BONE_POS Vehicle uses actual bone position for headlight positioning (warning: Expensive).
FLAG_FAKE_EXTRALIGHTS Vehicle's extra light don't cast lights but are turned on and off when headlights are.
FLAG_CANNOT_BE_MODDED Stops the vehicle from being modded.
FLAG_DONT_SPAWN_AS_AMBIENT Stops the vehicle from spawning in the ambient population.
FLAG_IS_BULKY Vehicle is bulky (vans, suvs, etc.) and will be preferred for cargen spawns.
FLAG_BLOCK_FROM_ATTRACTOR_SCENARIO Stops the vehicle from being attracted by vehicle scenarios.
FLAG_IS_BUS This vehicle is a bus.
FLAG_USE_STEERING_PARAM_FOR_LEAN Pass the steering move param rather then the lean.
FLAG_CANNOT_BE_DRIVEN_BY_PLAYER Player can't drive this vehicle.
FLAG_SPRAY_PETROL_BEFORE_EXPLOSION Whether or not to play a spraying petrol vfx before explosion.
FLAG_ATTACH_TRAILER_ON_HIGHWAY Allows attachment of trailers on highway.
FLAG_ATTACH_TRAILER_IN_CITY Allows attachment of trailers in the city (i.e. non highway roads but still no narrow ones).
FLAG_HAS_NO_ROOF Vehicle doesn't have a roof.
FLAG_ALLOW_TARGETING_OF_OCCUPANTS Allow locking on to vehicle occupant.s
FLAG_RECESSED_HEADLIGHT_CORONAS Head light coronas are recessed inside vehicle body (corona visibility is restricted).
FLAG_RECESSED_TAILLIGHT_CORONAS Tail light coronas are recessed inside vehicle body (corona visibility is restricted).
FLAG_IS_TRACKED_FOR_TRAILS This vehicle is tracked the purpose of making trails in the world (i.e. grass).
FLAG_HEADLIGHTS_ON_LANDINGGEAR The headlights are/is attached to the landing gears.
FLAG_CONSIDERED_FOR_VEHICLE_ENTRY_WHEN_STOOD_ON If stood on this vehicle, we'll try to enter it.
FLAG_GIVE_SCUBA_GEAR_ON_EXIT Equips the ped with scuba gear when exiting.
FLAG_IS_DIGGER Defines the vehicle as a digger. Adjusts how peds enter.
FLAG_IS_TANK Defines the vehicle as a tank.
FLAG_USE_COVERBOUND_INFO_FOR_COVERGEN
FLAG_CAN_BE_DRIVEN_ON This allows other vehicles to drive on this without the wheels ignoring impacts due to the chassis hitting the vehicle first.
FLAG_HAS_BULLETPROOF_GLASS Glass can't be broken.
FLAG_CANNOT_TAKE_COVER_WHEN_STOOD_ON Prevents peds from taking cover while on top of the vehicle.
FLAG_INTERIOR_BLOCKED_BY_BOOT Has a hollow interior that can be entered by a boot door mechanism.
FLAG_DONT_TIMESLICE_WHEELS Turn off wheel time slicing optimization for this vehicle.
FLAG_FLEE_FROM_COMBAT If in this vehicle when entering combat peds will flee instead of fight.
FLAG_DRIVER_SHOULD_BE_FEMALE This vehicle should use only female drivers.
FLAG_DRIVER_SHOULD_BE_MALE This vehicle should use only male drivers.
FLAG_COUNT_AS_FACEBOOK_DRIVEN This vehicle will count towards all vehicle driven post to Facebook.
FLAG_BIKE_CLAMP_PICKUP_LEAN_RATE This smooths out the pickup of bikes with luggage outside the rear wheel.
FLAG_PLANE_WEAR_ALTERNATIVE_HELMET If this is set then we use an alternative helmet for these vehicles.
FLAG_USE_STRICTER_EXIT_COLLISION_TESTS If vehicle is parked sideways on a slope we check against the vehicle to prevent getting stuck or walking through it.
FLAG_TWO_DOORS_ONE_SEAT Vehicle has 2 doors for 1 seat. Changes how the ped enters.
FLAG_USE_LIGHTING_INTERIOR_OVERRIDE If vehicle can have passengers inside of it in MP. override the lighting when there is no view to the outside.
FLAG_USE_RESTRICTED_DRIVEBY_HEIGHT Don't blend in the high sweep during drive-bys.
FLAG_CAN_HONK_WHEN_FLEEING This vehicle can, under certain conditions, honk its horn while fleeing.
FLAG_PEDS_INSIDE_CAN_BE_SET_ON_FIRE_MP Allows peds inside the vehicle to be set on fire in mp (take damage).
FLAG_REPORT_CRIME_IF_STANDING_ON Standing on this vehicle as a player will get a crime reported.
FLAG_HELI_USES_FIXUPS_ON_OPEN_DOOR Perform fixups on AlignToEnterSeat and OpenDoor task states (because the anims don't use climb_up).
FLAG_FORCE_ENABLE_CHASSIS_COLLISION
FLAG_CANNOT_BE_PICKUP_BY_CARGOBOB If set, it can not be picked up by the cargobob's grappling hook.
FLAG_CAN_HAVE_NEONS If set, this car can spawn in the ambient population with neon lights on.
FLAG_HAS_INTERIOR_EXTRAS If set, this vehicle will treat extras 10, 11, and 12 as special interior extras which always have a chance of spawning.
FLAG_HAS_TURRET_SEAT_ON_VEHICLE Vehicle has a turret with a seat.
FLAG_ALLOW_OBJECT_LOW_LOD_COLLISION This vehicle allows certain objects to collide with the low-LOD chassis rather than the regular chassis.
FLAG_DISABLE_AUTO_VAULT_ON_VEHICLE Prevents peds from automatically climbing on the vehicle.
FLAG_USE_TURRET_RELATIVE_AIM_CALCULATION
FLAG_USE_FULL_ANIMS_FOR_MP_WARP_ENTRY_POINTS Force full animations to play on vehicle entry points marked as MPWarpInOut (if available).
FLAG_HAS_DIRECTIONAL_SHUFFLES Used for seat shuffling when a vehicle has multiple turrets.
FLAG_DISABLE_WEAPON_WHEEL_IN_FIRST_PERSON This vehicle prevents the weapon wheel from displaying if in first person.
FLAG_USE_PILOT_HELMET This vehicle uses PV_FLAG_PILOT_HELMET instead of the standard flight helmet, even if the vehicle seat has no weapons.
FLAG_USE_WEAPON_WHEEL_WITHOUT_HELMET
FLAG_PREFER_ENTER_TURRET_AFTER_DRIVER If this vehicle already has a driver, prefer entering the turret seats.
FLAG_USE_SMALLER_OPEN_DOOR_RATIO_TOLERANCE Consider doors of this vehicle to be open with a smaller open door ratio.
FLAG_USE_HEADING_ONLY_IN_TURRET_MATRIX Returns the turret matrix computed from the aim heading only.
FLAG_DONT_STOP_WHEN_GOING_TO_CLIMB_UP_POINT Don't stop moving when doing automatic climb ups.
FLAG_HAS_REAR_MOUNTED_TURRET Vehicle has a turret facing the rear.
FLAG_DISABLE_BUSTING Dont allow cops to bust a player in this vehicle.
FLAG_IGNORE_RWINDOW_COLLISION Ignore bullet collision with the vehicle if shooting through rear windscreen.
FLAG_HAS_GULL_WING_DOORS The doors of this vehicle open upwards instead of outwards.
FLAG_CARGOBOB_HOOK_UP_CHASSIS Uses chassis bounding box to compute the offset for Cargobob's grappling hook attachment.
FLAG_USE_FIVE_ANIM_THROW_FP Allow vehicle to use wider throw animations, but only in first person.
FLAG_ALLOW_HATS_NO_ROOF Ensures hats don't get hidden when warping a ped into a vehicle if the vehicle has FLAG_NO_ROOF flag set.
FLAG_HAS_REAR_SEAT_ACTIVITIES Rear seat has activities. Used for allowing rear seat entry.
FLAG_HAS_LOWRIDER_HYDRAULICS Vehicle has lowrider hydraulics.
FLAG_HAS_BULLET_RESISTANT_GLASS Glass on this vehicle has a health bar, it won't smash until health gets below 0. Damage applied depends on weapon. The collision ID for the windows must be 122 for this flag to work.
FLAG_HAS_INCREASED_RAMMING_FORCE Vehicle is armored and can ram roadblocks / other cars much easier.
FLAG_HAS_CAPPED_EXPLOSION_DAMAGE Damage from an explosion is capped, allowing the vehicle to take one hit from an explosion without instantly exploding. Search for EXPLOSIVE_DAMAGE_CAP_FOR_FLAGGED_VEHICLES to find capped value.
FLAG_HAS_LOWRIDER_DONK_HYDRAULICS Vehicle has lowrider donk hydraulics.
FLAG_HELICOPTER_WITH_LANDING_GEAR Vehicle is a helicopter that has landing gears like planes (that can be lowered or raised).
FLAG_JUMPING_CAR Vehicle can perform a jump.
FLAG_HAS_ROCKET_BOOST Vehicle has a rechargeable rocket boost.
FLAG_RAMMING_SCOOP Vehicle has a scoop in front that can ram other cars to the side.
FLAG_HAS_PARACHUTE Vehicle has a parachute.
FLAG_RAMP Vehicle can be used as a ramp.
FLAG_HAS_EXTRA_SHUFFLE_SEAT_ON_VEHICLE Vehicle has extra shuffle seats that can be manually moved between (similar to some functionality of the turret seats).
FLAG_FRONT_BOOT Vehicle has its boot at the front.
FLAG_HALF_TRACK Vehicle has normal wheels at the front but tracks at the rear.
FLAG_RESET_TURRET_SEAT_HEADING The turret heading should be reset when there is no one using it.
FLAG_TURRET_MODS_ON_ROOF The roof mods are used to store the turret mod.
FLAG_UPDATE_WEAPON_BATTERY_BONES The weapon battery bones need to be updated.
FLAG_DONT_HOLD_LOW_GEARS_WHEN_ENGINE_UNDER_LOAD The gearbox should shift up as soon as it reaches the shift up point even when the engine is under load.
FLAG_HAS_GLIDER The vehicle is equipped with a glider.
FLAG_INCREASE_LOW_SPEED_TORQUE Torque is increased at low speed to aid getting up hills.
FLAG_USE_AIRCRAFT_STYLE_WEAPON_TARGETING Does the same behavior has aircraft for targeting (only locks onto players and hostile targets) and reticles (renders along weapon probe).
FLAG_KEEP_ALL_TURRETS_SYNCHRONISED Makes sure all turret base and barrel bones have the same rotation.
FLAG_SET_WANTED_FOR_ATTACHED_VEH If player inside this vehicle gets wanted level, this flag will also give the same wanted level to any peds inside attached vehicles (like trailer) and vice versa.
FLAG_TURRET_ENTRY_ATTACH_TO_DRIVER_SEAT Force attach ped to the driver seat when entering a turret seat that can rotate, in order to correctly calculate align positions.
FLAG_USE_STANDARD_FLIGHT_HELMET Force the standard flight helmet to be used instead of the PV_FLAG_PILOT_HELMET, even if the vehicle seat has weapons.
FLAG_SECOND_TURRET_MOD Has a secondary turret mod.
FLAG_THIRD_TURRET_MOD Has a third turret mod.
FLAG_HAS_EJECTOR_SEATS Hey, what does this button do?
FLAG_TURRET_MODS_ON_CHASSIS Has turret mods in the chassis mod slot.
FLAG_HAS_JATO_BOOST_MOD Has a jato rocket boost to assist takeoff, uses the exhaust mod slot.
FLAG_IGNORE_TRAPPED_HULL_CHECK Will not do shapetests to see if we're trapped in convex hull. This will make ped always go to climb up point directly.
FLAG_HOLD_TO_SHUFFLE Will make shuffling between seats be on hold rather than tap.
FLAG_TURRET_MOD_WITH_NO_STOCK_TURRET The vehicle does not have a turret as stock, but ones should be activated with an appropriate mod.
FLAG_EQUIP_UNARMED_ON_ENTER Forces unarmed weapon to be equipped when entering the vehicle.
FLAG_DISABLE_CAMERA_PUSH_BEYOND Disables camera behavior that pushes the camera beyond this entity during spawning, useful for very large vehicles.
FLAG_HAS_VERTICAL_FLIGHT_MODE Has a vertical flight mode.
FLAG_HAS_OUTRIGGER_LEGS Has outrigger legs that need to be deployed.
FLAG_CAN_NAVIGATE_TO_ON_VEHICLE_ENTRY Flags standard vehicles as having on-vehicle entry points to navigate towards when standing on the vehicle. Aquatic vehicles and planes use this behavior by default.
FLAG_DROP_SUSPENSION_WHEN_STOPPED Suspension lowers when the vehicle is stopped.
FLAG_DONT_CRASH_ABANDONED_NEAR_GROUND Dont crash the vehicle near ground if everyone exited it.
FLAG_USE_INTERIOR_RED_LIGHT Vehicle needs a special red interior light.
FLAG_HAS_HELI_STRAFE_MODE It is a helicopter with a special strafe handling mode.
FLAG_HAS_VERTICAL_ROCKET_BOOST Has a rocket boost, or rocket boost mod, that works vertically.
FLAG_CREATE_WEAPON_MANAGER_ON_SPAWN Creates vehicle weapon manager on spawn instead of entering a seat with a vehicle weapon. This is already done for tanks and some vehicles with turret seats automatically.
FLAG_USE_ROOT_AS_BASE_LOCKON_POS Makes lockon position to be root of the vehicle instead of center position of the bounding box.
FLAG_HEADLIGHTS_ON_TAP_ONLY Makes headlights only toggle on tap of a button, not a hold.
FLAG_CHECK_WARP_TASK_FLAG_DURING_ENTER Adds an additional check when checking if a ped is warping.
FLAG_USE_RESTRICTED_DRIVEBY_HEIGHT_HIGH Don't blend in the low sweep during drive-bys.
FLAG_INCREASE_CAMBER_WITH_SUSPENSION_MOD Increases the front wheel camber when a suspension mod is applied.
FLAG_NO_HEAVY_BRAKE_ANIMATION Prevents heavy brake animation from being applied (due to low roof, etc.).
FLAG_HAS_TWO_BONNET_BONES Vehicle has two linked bonnet bones.
FLAG_DONT_LINK_BOOT2 The special linked door bone shouldn't be linked.
FLAG_HAS_INCREASED_RAMMING_FORCE_WITH_CHASSIS_MOD If the vehicle has the best chassis mod then it will have increased ramming force.
FLAG_HAS_INCREASED_RAMMING_FORCE_VS_ALL_VEHICLES The increased ramming force is applied against all vehicles not just police ones.
FLAG_HAS_EXTENDED_COLLISION_MODS Any of the mod bones can be used to enable or disable collision.
FLAG_HAS_NITROUS_MOD The vehicle has mods that can enable nitrous.
FLAG_HAS_JUMP_MOD The vehicle has mods that can enable jump boost.
FLAG_HAS_RAMMING_SCOOP_MOD The vehicle has mods that enable the ramming scoop.
FLAG_HAS_SUPER_BRAKES_MOD The vehicle has mods that enable the to stop very quickly.
FLAG_CRUSHES_OTHER_VEHICLES The vehicle crushes other vehicles when it drives over them.
FLAG_HAS_WEAPON_BLADE_MODS Has weapon blade mods.
FLAG_HAS_WEAPON_SPIKE_MODS Has weapon spike mods.
FLAG_FORCE_BONNET_CAMERA_INSTEAD_OF_POV Will always use bonnet camera instead of POV camera, ignoring pause menu option.
FLAG_RAMP_MOD Vehicle can be used as a ramp if the mod is enabled.
FLAG_HAS_TOMBSTONE Has a breakable off bumper mod.
FLAG_HAS_SIDE_SHUNT Has a side shunt mod - uses mod slot VMT_ENGINEBAY2.
FLAG_HAS_FRONT_SPIKE_MOD Has front spike mods.
FLAG_HAS_RAMMING_BAR_MOD Has front ramming bar mods.
FLAG_TURRET_MODS_ON_CHASSIS5 Uses the same turret mod setup as the FLAG_TURRET_MODS_ON_ROOF but they are on CHASSIS5.
FLAG_HAS_SUPERCHARGER The vehicle model looks like it has a supercharger. At the moment this only affects the gauges.
FLAG_IS_TANK_WITH_FLAME_DAMAGE The vehicle is a tank that can take fire damage.
FLAG_DISABLE_DEFORMATION The vehicle doesn't deform.
FLAG_ALLOW_RAPPEL_AI_ONLY Allow AI peds to rappel from vehicles that don't support it.
FLAG_USE_RESTRICTED_DRIVEBY_HEIGHT_MID_ONLY Don't blend high or low sweeps during drive-bys.
FLAG_FORCE_AUTO_VAULT_ON_VEHICLE_WHEN_STUCK Will force auto vault scan when stuck on top of this vehicle.
FLAG_SPOILER_MOD_DOESNT_INCREASE_GRIP The mod that has been allocated the spoiler slot should not increase downforce.
FLAG_NO_REVERSING_ANIMATION Prevents reversing animation from being applied (due to low roof, etc.).
FLAG_IS_QUADBIKE_USING_BIKE_ANIMATIONS Allows quadbikes to use bike animations / layouts.
FLAG_IS_FORMULA_VEHICLE Marks vehicle as a Formula vehicle, currently used to warp out of the vehicle when on its side and changes the tire marks from standard to slick.
FLAG_LATCH_ALL_JOINTS Latches all the joints when the vehicle is created.
FLAG_REJECT_ENTRY_TO_VEHICLE_WHEN_STOOD_ON If stood on this vehicle, don't consider it for entry.
FLAG_CHECK_IF_DRIVER_SEAT_IS_CLOSER_THAN_TURRETS_WITH_ON_BOARD_ENTER Checks if the driver seat is closer than found turret seat when entering while stood on the vehicle.
FLAG_RENDER_WHEELS_WITH_ZERO_COMPRESSION Even if a vehicle has suspension just render the wheels as if they have none.
FLAG_USE_LENGTH_OF_VEHICLE_BOUNDS_FOR_PLAYER_LOCKON_POS Dynamically adjusts player's lock on position using the vehicle bounds.
FLAG_PREFER_FRONT_SEAT Prefer the front seat rather than rear seats in this vehicle (Boss peds normally go for rear seats).

Compilation of all vehicles' metadata files (including their flags): https://forum.cfx.re/t/vehicle-meta-files-last-dlc/5142301

## Parameters
* **vehicle**: The vehicle to obtain data for.
* **flagIndex**: Flag index (0-203)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The number of flags might be different in various game builds, it's worth mentioning in the docs above, I believe, and removing it from this specific line.


## Return value
A boolean for whether the flag is set.