class Vehicle
package fivem.client.natives
Static methods
staticAreBombBayDoorsOpen(aircraft:Dynamic):Bool
Returns true when the bomb bay doors of this plane are open. False if they're closed.
staticAreHeliStubWingsDeployed(vehicle:Dynamic):Bool
Only used with the "akula" in the decompiled native scripts.
NativeDB Introduced: v1290staticAreOutriggerLegsDeployed(vehicle:Dynamic):Bool
Returns whether the outrigger legs are deployed for the vehicle. The Chernobog is one of the few vehicles with outrigger legs.
NativeDB Introduced: v1290staticArePlaneWingsIntact(plane:Dynamic):Bool
staticAttachContainerToHandlerFrame(handler:Dynamic, container:Dynamic):Dynamic
staticClearVehiclePhoneExplosiveDevice():Dynamic
staticDisableVehicleNeonLights(vehicle:Dynamic, toggle:Bool):Dynamic
staticDisableVehicleTurretMovementThisFrame(vehicle:Dynamic):Dynamic
staticDisableVehicleWorldCollision(vehicle:Dynamic):Dynamic
Disables collision for this vehicle (maybe it also supports other entities, not sure). Only world/building/fixed world objects will have their collisions disabled, props, peds, or any other entity still collides with the vehicle.
Not sure if there is a native (and if so, which one) that resets the collisions.
staticDoesVehicleAllowRappel(vehicle:Dynamic):Bool
Returns true if the vehicle has the FLAG_ALLOWS_RAPPEL flag set.staticDoesVehicleTyreExist(vehicle:Dynamic, tyreIndex:Int):Bool
Checks if vehicle tyre at index exists. Also returns false if tyre was removed.
NativeDB Introduced: v1493staticEjectJb700Roof(vehicle:Dynamic, x:Float, y:Float, z:Float):Dynamic
staticEnableAircraftObstacleAvoidance(vehicle:Dynamic, avoidObstacles:Bool):Dynamic
Will disable a plane or a helicopter's need to swerve around object in its heightmap when using TASK_PLANE_MISSION or other AI / Pilot behavior. Will ensure plane flys directly to it's destination or die trying! This native does NOT need to be called every frame, but instead, just called once on the vehicle (NOT THE PED) you're trying to disable avoidance for!
staticFindRandomPointInSpace(ped:Dynamic):Dynamic
Native is significantly more complicated than simply generating a random vector & length.
The 'point' is either 400.0 or 250.0 units away from the Ped's current coordinates; and paths into functions like rage::grcViewport___IsSphereVisible.
NativeDB Introduced: v1290staticFindVehicleCarryingThisEntity(entity:Dynamic):Dynamic
Finds the vehicle that is carrying this entity with a handler frame.
The model of the entity must be prop_contr_03b_ld or the function will return 0.staticGetAllVehicles(vehArray:Dynamic):Int
staticGetBoatBoomPositionRatio2(vehicle:Dynamic, p1:Bool):Dynamic
Same call as VEHICLE::_0x0F3B4D4E43177236staticGetBoatBoomPositionRatio3(vehicle:Dynamic, p1:Bool):Dynamic
staticGetCanVehicleJump(vehicle:Dynamic):Bool
Returns true if the vehicle has the FLAG_JUMPING_CAR flag set.staticGetCargobobHookPosition(cargobob:Dynamic):Dynamic
Gets the position of the cargobob hook, in world coords.
staticGetEntityAttachedToCargobob(vehicle:Dynamic):Dynamic
staticGetEntryPositionOfDoor(vehicle:Dynamic, doorIndex:Int):Dynamic
See eDoorId declared in SET_VEHICLE_DOOR_SHUT
staticGetHasRetractableWheels(vehicle:Dynamic):Bool
staticGetHasRocketBoost(vehicle:Dynamic):Bool
staticGetIsDoorValid(vehicle:Dynamic, doorIndex:Int):Bool
See eDoorId declared in SET_VEHICLE_DOOR_SHUT
staticGetIsVehicleElectric(vehicleModel:Int):Bool
Checks if the vehicle is electric.
NativeDB Introduced: v3258staticGetIsVehicleEmpDisabled(vehicle:Dynamic):Bool
Returns whether this vehicle is currently disabled by an EMP mine.
NativeDB Introduced: v1604staticGetIsWheelsLoweredStateActive(vehicle:Dynamic):Bool
staticGetLastRammedVehicle(vehicle:Dynamic):Dynamic
Returns last vehicle that was rammed by the given vehicle using the shunt boost.
NativeDB Introduced: v1604staticGetNumberOfVehicleDoors(vehicle:Dynamic):Int
staticGetRemainingNitrousDuration(vehicle:Dynamic):Float
NativeDB Introduced: 3095
Retrieves the remaining duration of nitrous boost available for the specified vehicle.
staticGetVehicleBombCount(aircraft:Dynamic):Int
Gets the amount of bombs that this vehicle has. As far as I know, this does not impact vehicle weapons or the ammo of those weapons in any way, it is just a way to keep track of the amount of bombs in a specific plane.
In decompiled scripts this is used to check if the vehicle has enough bombs before a bomb can be dropped (bombs are dropped by using _SHOOT_SINGLE_BULLET_BETWEEN_COORDS_WITH_EXTRA_PARAMS).
Use _SET_AIRCRAFT_BOMB_COUNT to set the amount of bombs on that vehicle.
staticGetVehicleCanActivateParachute(vehicle:Dynamic):Bool
staticGetVehicleCountermeasureCount(aircraft:Dynamic):Int
Similar to _GET_AIRCRAFT_BOMB_COUNT, this gets the amount of countermeasures that are present on this vehicle.
Use _SET_AIRCRAFT_COUNTERMEASURE_COUNT to set the current amount.
staticGetVehicleCurrentSlipstreamDraft(vehicle:Dynamic):Float
Returns a float value between 0.0 and 3.0 related to its slipstream draft (boost/speedup).
GET_VEHICLE_*staticGetVehicleDashboardColor(vehicle:Dynamic, color:Dynamic):Dynamic
staticGetVehicleDrivetrainType(vehicleModel:Int):Int
NativeDB Introduced: v3258
Note: When using this native, the hash of the vehicle needs to be loaded into the client's memory. This can be done by requesting the model with REQUEST_MODEL or by simply having the vehicle spawned.
enum eVehicleDrivetrainType
{
INVALID = 0,
FWD = 1,
RWD = 2,
AWD = 3
};
NativeDB Introduced: v3258staticGetVehicleHasParachute(vehicle:Dynamic):Bool
staticGetVehicleInteriorColor(vehicle:Dynamic, color:Dynamic):Dynamic
staticGetVehicleModelEstimatedAgility(modelHash:Int):Float
GET_VEHICLE_MODEL_*
9.8 * thrust if air vehicle, else 0.38 + drive force?staticGetVehicleModelMaxKnots(modelHash:Int):Float
GET_VEHICLE_MODEL_*
Function pertains only to aviation vehicles.staticGetVehicleNeonLightsColour(vehicle:Dynamic, r:Dynamic, g:Dynamic, b:Dynamic):Dynamic
Gets the color of the neon lights of the specified vehicle.
See _SET_VEHICLE_NEON_LIGHTS_COLOUR for more information
staticGetVehicleNumberOfBrokenBones(vehicle:Dynamic):Int
staticGetVehicleNumberOfBrokenOffBones(vehicle:Dynamic):Int
Also includes some "turnOffBones" when vehicle mods are installed.staticGetVehicleRoofLivery(vehicle:Dynamic):Int
Returns index of the current vehicle's rooftop livery. A getter for _SET_VEHICLE_ROOF_LIVERY.
staticGetVehicleRoofLiveryCount(vehicle:Dynamic):Int
Returns a number of available rooftop liveries, or -1 if vehicle has no rooftop liveries available.
staticGetVehicleSuspensionBounds(vehicle:Dynamic, out1:Dynamic, out2:Dynamic):Dynamic
Outputs 2 Vector3's.
Scripts check if out2.x - out1.x > something.x
Could be suspension related, as in max suspension height and min suspension height, considering the natives location.staticGetVehicleSuspensionHeight(vehicle:Dynamic):Float
Gets the height of the vehicle's suspension.
The higher the value the lower the suspension. Each 0.002 corresponds with one more level lowered.
0.000 is the stock suspension.
0.008 is Ultra Suspension. staticGetVehicleWeaponCapacity(vehicle:Dynamic, weaponIndex:Int):Int
staticGetVehicleXenonLightsColor(vehicle:Dynamic):Int
Use _SET_VEHICLE_HEADLIGHTS_COLOUR to set the headlights color for the vehicle.
You must enable xenon headlights for this native to work properly.
enum eHeadlightColors {
Default = 255,
White = 0,
Blue = 1,
ElectricBlue = 2,
MintGreen = 3,
LimeGreen = 4,
Yellow = 5,
GoldenShower = 6,
Orange = 7,
Red = 8,
PonyPink = 9,
HotPink = 10,
Purple = 11,
Blacklight = 12
}staticIsHandlerFrameAboveContainer(handler:Dynamic, container:Dynamic):Bool
staticIsPedExclusiveDriverOfVehicle(ped:Dynamic, vehicle:Dynamic, outIndex:Dynamic):Bool
staticIsThisModelAnAmphibiousCar(model:Int):Bool
staticIsThisModelAnAmphibiousQuadbike(model:Int):Bool
staticIsVehicleBeingHalted(vehicle:Dynamic):Bool
Returns true if vehicle is halted by BRING_VEHICLE_TO_HALT
_IS_VEHICLE_*
NativeDB Introduced: v1493staticIsVehicleDamaged(vehicle:Dynamic):Bool
Appears to return true if the vehicle has any damage, including cosmetically.
GET_*staticIsVehicleEngineOnFire(vehicle:Dynamic):Bool
Only ever used once in decompiled scripts: am_pi_menu: Returns true if the engine is on fire, or if the vehicle engine health is < 0 and it has been on fire.
It sometimes doesn't return true when the vehicle engine has been on fire, and has since been fixed. I'm not really sure what the exact conditions are.
This usually returns true even if there are no visible flames yet (engine health > 0). However if you monitor engine health you'll see that it starts decreasing as soon as this returns true.
staticIsVehicleModHswExclusive(vehicle:Dynamic, modType:Int, modIndex:Int):Bool
mpsum2_g9ec
NativeDB Introduced: v2699staticIsVehicleNeonLightEnabled(vehicle:Dynamic, index:Int):Bool
indices:
0 = Left
1 = Right
2 = Front
3 = Back staticIsVehicleParachuteActive(vehicle:Dynamic):Bool
Does not work for vehicle of type: CBike, CBmx, CBoat, CTrain, CSubmarine.
staticIsVehicleRocketBoostActive(vehicle:Dynamic):Bool
staticIsVehicleSeatAccessible(ped:Dynamic, vehicle:Dynamic, seatIndex:Int, side:Bool, onEnter:Bool):Bool
Check if a vehicle seat is accessible. If you park your vehicle near a wall and the ped cannot enter/exit this side, the return value toggles from true (not blocked) to false (blocked).
side = only relevant for bikes/motorcycles to check if the left (false)/right (true) side is blocked.
onEnter = check if you can enter (true) or exit (false) a vehicle.staticIsVehicleSlipstreamLeader(vehicle:Dynamic):Bool
staticIsVehicleWeaponDisabled(weaponHash:Int, vehicle:Dynamic, owner:Dynamic):Bool
staticLowerRetractableWheels(vehicle:Dynamic):Dynamic
staticNetworkUseHighPrecisionVehicleBlending(vehicle:Dynamic, toggle:Bool):Dynamic
Implemented only for Trains.
NativeDB Introduced: v2372staticRaiseRetractableWheels(vehicle:Dynamic):Dynamic
staticRemoveVehicleShadowEffect(vehicle:Dynamic):Dynamic
Remove the weird shadow applied by _SET_VEHICLE_SHADOW_EFFECT
staticSetBoatBoomPositionRatio(vehicle:Dynamic, ratio:Float):Dynamic
Sets the boat boom position for the TR3 trailer.
Ratio value is between 0.0 and 1.0, where 0.0 is 90 degrees to the left of the boat, and 1.0 is just slightly to the right/back of the boat.
To get the current boom position ratio, use GET_BOAT_BOOM_POSITION_RATIO.
staticSetBoatIsSinking(vehicle:Dynamic):Dynamic
staticSetCamberedWheelsDisabled(vehicle:Dynamic, toggle:Bool):Dynamic
staticSetCarHighSpeedBumpSeverityMultiplier(multiplier:Float):Dynamic
Something to do with "high speed bump severity"?
if (!sub_87a46("SET_CAR_HIGH_SPEED_BUMP_SEVERITY_MULTIPLIER")) {
VEHICLE::_84FD40F56075E816(0.0);
sub_8795b("SET_CAR_HIGH_SPEED_BUMP_SEVERITY_MULTIPLIER", 1);
} staticSetCargobobHookCanAttach(vehicle:Dynamic, toggle:Bool):Dynamic
Stops the cargobob from being able to attach any vehicle
NativeDB Introduced: v1180staticSetDeployHeliStubWings(vehicle:Dynamic, deploy:Bool, p2:Bool):Dynamic
Only used with the "akula" and "annihilator2" in the decompiled native scripts.
NativeDB Introduced: v1290staticSetDisableSuperdummyMode(vehicle:Dynamic, p1:Bool):Dynamic
staticSetDisableTurretMovementThisFrame(vehicle:Dynamic, turretIdx:Int):Dynamic
Disables turret movement when called in a loop. You can still fire and aim. You cannot shoot backwards though.
NativeDB Introduced: v1365staticSetDisableVehicleFlightNozzlePosition(vehicle:Dynamic, direction:Bool):Dynamic
True stops vtols from switching modes. Doesn't stop the sound though.
NativeDB Introduced: v1290staticSetDisableVehicleWindowCollisions(vehicle:Dynamic, toggle:Bool):Dynamic
R* used it to "remove" vehicle windows when "nightshark" had some mod, which adding some kind of armored windows. When enabled, you can't break vehicles glass. All your bullets wiil shoot through glass. You also will not able to break the glass with any other way (hitting and etc)
staticSetHeliMainRotorHealth(vehicle:Dynamic, health:Float):Dynamic
staticSetHeliTailRotorHealth(vehicle:Dynamic, health:Float):Dynamic
staticSetHelicopterRollPitchYawMult(helicopter:Dynamic, multiplier:Float):Dynamic
value between 0.0 and 1.0 staticSetHydraulicRaised(vehicle:Dynamic, toggle:Bool):Dynamic
staticSetHydraulicWheelState(vehicle:Dynamic, state:Int):Dynamic
staticSetHydraulicWheelStateTransition(vehicle:Dynamic, wheelId:Int, state:Int, value:Float, p4:Float):Dynamic
Sets vehicle wheel hydraulic states transition. Known states:
0 - reset
1 - raise wheel (uses value arg, works just like _SET_VEHICLE_HYDRAULIC_WHEEL_VALUE)
2 - jump using wheelstaticSetHydraulicWheelValue(vehicle:Dynamic, wheelId:Int, value:Float):Dynamic
Works only on vehicles that support hydraulic.staticSetOppressorTransformState(vehicle:Dynamic, extend:Bool):Dynamic
Set state to true to extend the wings, false to retract them.
staticSetPlaneEngineHealth(vehicle:Dynamic, health:Float):Dynamic
Works just like SET_VEHICLE_ENGINE_HEALTH, didn't saw any difference. But this native works only for planes.staticSetPlanePropellersHealth(plane:Dynamic, health:Float):Dynamic
staticSetReduceDriftVehicleSuspension(vehicle:Dynamic, enable:Bool):Dynamic
Lowers the vehicle's stance. Only works for vehicles that support this feature.
NativeDB Introduced: v2372staticSetTrailerLegsLowered():Dynamic
Inverse of 0x95CF53B3D687F9FA
NativeDB Added Parameter 1: Vehicle vehiclestaticSetTyreHealth(vehicle:Dynamic, wheelIndex:Int, health:Float):Dynamic
NativeDB Introduced: v1868staticSetTyreSoftnessMultiplier(vehicle:Dynamic, wheelIndex:Int, multiplier:Float):Dynamic
Controls how fast the tires wear out.
Default values from Rockstar's Open Wheel Race JSON's:
"owrtss" (Soft): 2.2
"owrtsm" (Medium): 1.7
"owrtsh" (Hard): 1.2
Usable wheels:
0: wheel_lf
1: wheel_rf
2: wheel_lm1
3: wheel_rm1
4: wheel_lr
5: wheel_rr
NativeDB Introduced: v2060staticSetTyreTractionLossMultiplier(vehicle:Dynamic, wheelIndex:Int, multiplier:Float):Dynamic
Controls how much traction the wheel loses.
Default values from Rockstar's Open Wheel Race JSON's:
"owrtds" (Soft): 0.05
"owrtdm" (Medium): 0.45
"owrtdh" (Hard): 0.8
Usable wheels:
0: wheel_lf
1: wheel_rf
2: wheel_lm1
3: wheel_rm1
4: wheel_lr
5: wheel_rr
NativeDB Introduced: v2060staticSetTyreWearMultiplier(vehicle:Dynamic, wheelIndex:Int, multiplier:Float):Dynamic
NativeDB Introduced: v1868staticSetUseHigherVehicleJumpForce(vehicle:Dynamic, toggle:Bool):Dynamic
Allows vehicles with the FLAG_JUMPING_CAR flag to jump higher (i.e. Ruiner 2000).
staticSetVehicleBombCount(aircraft:Dynamic, bombCount:Int):Dynamic
Sets the amount of bombs that this vehicle has. As far as I know, this does not impact vehicle weapons or the ammo of those weapons in any way, it is just a way to keep track of the amount of bombs in a specific plane.
In decompiled scripts this is used to deduct from or add to the count whenever bombs are dropped or purchased/restocked.
Use _GET_AIRCRAFT_BOMB_COUNT to get the amount of bombs on that vehicle.
staticSetVehicleCanEngineOperateOnFire(vehicle:Dynamic, toggle:Bool):Dynamic
staticSetVehicleControlsInverted(vehicle:Dynamic, state:Bool):Dynamic
Inverts vehicle's controls. So INPUT_VEH_ACCELERATE will be INPUT_VEH_BRAKE and vise versa (same for A/D controls)
Doesn't work for planes/helis.staticSetVehicleCountermeasureCount(aircraft:Dynamic, count:Int):Dynamic
Similar to _SET_AIRCRAFT_BOMB_COUNT, this sets the amount of countermeasures that are present on this vehicle.
Use _GET_AIRCRAFT_COUNTERMEASURE_COUNT to get the current amount.
staticSetVehicleDashboardColor(vehicle:Dynamic, color:Int):Dynamic
staticSetVehicleDoorCanBreak(vehicle:Dynamic, doorIndex:Int, isBreakable:Bool):Dynamic
See eDoorId declared in SET_VEHICLE_DOOR_SHUT
staticSetVehicleExclusiveDriver2(vehicle:Dynamic, ped:Dynamic, index:Int):Dynamic
The actual SET_VEHICLE_EXCLUSIVE_DRIVER native.
staticSetVehicleHandlingHashForAi(vehicle:Dynamic, hash:Int):Dynamic
staticSetVehicleInteriorColor(vehicle:Dynamic, color:Int):Dynamic
staticSetVehicleMaxSpeed(vehicle:Dynamic, speed:Float):Dynamic
To reset the max speed, set the speed value to 0.0 or lower.
staticSetVehicleNeonLightEnabled(vehicle:Dynamic, index:Int, toggle:Bool):Dynamic
Sets the neon lights of the specified vehicle on/off.
Indices:
0 = Left
1 = Right
2 = Front
3 = Back staticSetVehicleNeonLightsColour(vehicle:Dynamic, r:Int, g:Int, b:Int):Dynamic
Sets the color of the neon lights on the specified vehicle.
RGB values and colour names taken from the decompiled scripts:
| Colour | R | G | B |
|---|---|---|---|
| White | 222 | 222 | 255 |
| Blue | 2 | 21 | 255 |
| Electric Blue | 3 | 83 | 255 |
| Mint Green | 0 | 255 | 140 |
| Lime Green | 94 | 255 | 1 |
| Yellow | 255 | 255 | 0 |
| Golden Shower | 255 | 150 | 0 |
| Orange | 255 | 62 | 0 |
| Red | 255 | 1 | 1 |
| Pony Pink | 255 | 50 | 100 |
| Hot Pink | 255 | 5 | 190 |
| Purple | 35 | 1 | 255 |
| Blacklight | 15 | 3 | 255 |
staticSetVehicleParachuteActive(vehicle:Dynamic, active:Bool):Dynamic
staticSetVehicleParachuteTextureVariation(vehicle:Dynamic, textureVariation:Int):Dynamic
colorIndex = 0 - 7staticSetVehicleRampLaunchModifier(vehicle:Dynamic, p1:Float):Dynamic
staticSetVehicleRampSidewaysLaunchMotion(vehicle:Dynamic, toggle:Bool):Dynamic
staticSetVehicleRampUpwardsLaunchMotion(vehicle:Dynamic, toggle:Bool):Dynamic
staticSetVehicleReceivesRampDamage(vehicle:Dynamic, toggle:Bool):Dynamic
staticSetVehicleReduceTraction(vehicle:Dynamic, val:Int):Dynamic
Often used in conjunction with: SET_VEHICLE_REDUCE_GRIP.
NativeDB Introduced: v1604staticSetVehicleRocketBoostActive(vehicle:Dynamic, active:Bool):Dynamic
staticSetVehicleRocketBoostPercentage(vehicle:Dynamic, percentage:Float):Dynamic
staticSetVehicleRocketBoostRefillTime(vehicle:Dynamic, time:Float):Dynamic
staticSetVehicleRoofLivery(vehicle:Dynamic, livery:Int):Dynamic
Used to set the tornado custom (convertible) rooftop livery.
Livery value that works for tornado custom is between 0 and 9 from what i can tell. Maybe 0-8 even.
Might work on other custom vehicles but im not sure what those might be, only confirmed it working with the tornado custom.
staticSetVehicleShadowEffect(vehicle:Dynamic, p1:Int, p2:Int):Dynamic
Adds some kind of shadow to the vehicle.
-1 disables the effect.
DISABLE_*staticSetVehicleSilent(vehicle:Dynamic, toggle:Bool):Dynamic
If set to TRUE, it seems to suppress door noises and doesn't allow the horn to be continuous. staticSetVehicleSt(vehicle:Dynamic, toggle:Bool):Dynamic
Has something to do with trains. Always precedes SET_MISSION_TRAIN_AS_NO_LONGER_NEEDED.
============================================
May be true that it can be used with trains not sure, but not specifically for trains. Go find Xbox360 decompiled scripts and search for 'func_1333' in freemode.c it isn't used just for trains. Thanks for the info tho.
Btw, func_1333 ends up calling this func which uses this native,
void func_1338(int iParam0)//Position
{
ENTITY::FREEZE_ENTITY_POSITION(iParam0, true);
ENTITY::SET_ENTITY_COLLISION(iParam0, false, 0);
ENTITY::SET_ENTITY_INVINCIBLE(iParam0, true);
VEHICLE::_0xDF594D8D(iParam0, true);
} staticSetVehicleTurretUnk(vehicle:Dynamic, index:Int, toggle:Bool):Dynamic
Toggles specific flag on turret
NativeDB Introduced: v1290staticSetVehicleUnkDamageMultiplier(vehicle:Dynamic, multiplier:Float):Dynamic
staticSetVehicleUseHornButtonForNitrous(vehicle:Dynamic, bToggle:Bool):Dynamic
NativeDB Introduced: v3095
Enables or disables the use of the vehicle's horn button for activating the nitrous system.
staticSetVehicleWeaponCapacity(vehicle:Dynamic, weaponIndex:Int, capacity:Int):Dynamic
staticSetVehicleWeaponsDisabled(vehicle:Dynamic, weaponSlot:Int):Dynamic
staticSetVehicleWheelsDealDamage(vehicle:Dynamic, toggle:Bool):Dynamic
Related to monster trucks in native scripts.
NativeDB Introduced: v1604staticSetVehicleXenonLightsColor(vehicle:Dynamic, color:Int):Dynamic
Paint index goes from 0 to 12.
You can find the list of colors and ids here: _GET_VEHICLE_HEADLIGHTS_COLOUR
staticaddRoadNodeSpeedZone(x:Float, y:Float, z:Float, radius:Float, speed:Float, p5:Bool):Int
staticaddVehicleCombatAngledAvoidanceArea(p0:Float, p1:Float, p2:Float, p3:Float, p4:Float, p5:Float, p6:Float):Dynamic
staticaddVehiclePhoneExplosiveDevice(vehicle:Dynamic):Dynamic
staticaddVehicleStuckCheckWithWarp(p0:Dynamic, p1:Float, p2:Dynamic, p3:Bool, p4:Bool, p5:Bool, p6:Dynamic):Dynamic
staticaddVehicleUpsidedownCheck(vehicle:Dynamic):Dynamic
staticallowAmbientVehiclesToAvoidAdverseConditions(vehicle:Dynamic):Dynamic
This native it's a debug native. Won't do anything.
staticareAllVehicleWindowsIntact(vehicle:Dynamic):Bool
Appears to return false if any window is broken. staticarePlaneControlPanelsIntact(vehicle:Dynamic, checkForZeroHealth:Bool):Bool
Queries whether the control panels of a plane are intact. This native is used to determine the operational status of a plane's cockpit controls, which can affect the plane's flyability.
staticarePlanePropellersIntact(plane:Dynamic):Bool
staticattachEntityToCargobob(vehicle:Dynamic, entity:Dynamic, p2:Int, x:Float, y:Float, z:Float):Dynamic
staticattachVehicleOnToTrailer(vehicle:Dynamic, trailer:Dynamic, offsetX:Float, offsetY:Float, offsetZ:Float, coordsX:Float, coordsY:Float, coordsZ:Float, rotationX:Float, rotationY:Float, rotationZ:Float, disableColls:Float):Dynamic
staticattachVehicleToCargobob(cargobob:Dynamic, vehicle:Dynamic, vehicleBoneIndex:Int, x:Float, y:Float, z:Float):Dynamic
staticattachVehicleToTowTruck(towTruck:Dynamic, vehicle:Dynamic, rear:Bool, hookOffsetX:Float, hookOffsetY:Float, hookOffsetZ:Float):Dynamic
HookOffset defines where the hook is attached. leave at 0 for default attachment.staticattachVehicleToTrailer(vehicle:Dynamic, trailer:Dynamic, radius:Float):Dynamic
staticbringVehicleToHalt(vehicle:Dynamic, distance:Float, duration:Int, bControlVerticalVelocity:Bool):Dynamic
This native makes the vehicle stop immediately, as it happens when we enter a multiplayer garage.
staticcanAnchorBoatHere(boat:Dynamic):Bool
Checks if a boat can be anchored at its present position without possibly intersecting collision later.
NativeDB Introduced: v323staticcanAnchorBoatHereIgnorePlayers(boat:Dynamic):Bool
Checks if a boat can be anchored at its present position, ignoring any players standing on the boat.
NativeDB Introduced: v678staticcanCargobobPickUpEntity(cargobob:Dynamic, entity:Dynamic):Bool
Determines whether the specified Cargobob can pick up a given entity.
staticcanShuffleSeat(vehicle:Dynamic, seatIndex:Int):Bool
staticclearLastDrivenVehicle():Dynamic
staticclearNitrous(vehicle:Dynamic):Dynamic
NativeDB Introduced: 3095
Resets or clears the nitrous system for a specified vehicle. You can check if a vehicle has nitrous with IS_NITROUS_ACTIVE
staticclearVehicleCustomPrimaryColour(vehicle:Dynamic):Dynamic
staticclearVehicleCustomSecondaryColour(vehicle:Dynamic):Dynamic
staticclearVehicleGeneratorAreaOfInterest():Dynamic
Removes the cargen area of interest and resumes normal cargen spawning.
You can set the area of interest with SET_VEHICLE_GENERATOR_AREA_OF_INTEREST
staticclearVehicleRouteHistory(vehicle:Dynamic):Dynamic
staticcloseBombBayDoors(vehicle:Dynamic):Dynamic
staticcontrolLandingGear(vehicle:Dynamic, state:Int):Dynamic
Works for vehicles with a retractable landing gear
landing gear states:
0: Deployed
1: Closing
2: Opening
3: Retracted staticcopyVehicleDamages(sourceVehicle:Dynamic, targetVehicle:Dynamic):Dynamic
Copies sourceVehicle's damage (broken bumpers, broken lights, etc.) to targetVehicle.
staticcreateMissionTrain(variation:Int, x:Float, y:Float, z:Float, direction:Bool):Dynamic
Train models must be requested before use. See trains.xml (located in Grand Theft Auto V\update\update.rpf\common\data\levels\gta5\trains.xml) for freight and metro variations.
Model names to request can be found by searching model_name in the file.
The Lua usage example provided down below has been provided in such way so users can test each and every train variation.
Newly added parameters (seen in 2372 build)
NativeDB Added Parameter 6: BOOL isNetwork
NativeDB Added Parameter 7: BOOL netMissionEntity- isNetwork: Whether to create a network object for the train. If false, the train exists only locally.
- netMissionEntity: Whether to register the train as pinned to the script host in the R* network model.
Train Models:
- freight
Carriage Models:
- freightcar
- freightcar2 (Added v2372)
- freightcont1
- freightcont2
- freightgrain
- metrotrain
- tankercar
Some train variations (default from trains.xml as of build 2372)
- Very long train and freight variation.
- Freight train only.
- Double metro train (with both models flipped opposite to each other). This used to be
25before the 2802 build, it also used to be24before the 2372 build.
- Double metro train (with both models flipped opposite to each other). This used to be
staticcreatePickUpRopeForCargobob(cargobob:Dynamic, state:Int):Dynamic
Drops the Hook/Magnet on a cargobob
enum eCargobobHook
{
CARGOBOB_HOOK = 0,
CARGOBOB_MAGNET = 1,
}; staticcreateScriptVehicleGenerator(x:Float, y:Float, z:Float, heading:Float, p4:Float, p5:Float, modelHash:Int, p7:Int, p8:Int, p9:Int, p10:Int, p11:Bool, p12:Bool, p13:Bool, p14:Bool, p15:Bool, p16:Int):Int
Creates a script vehicle generator at the given coordinates. Most parameters after the model hash are unknown.
Parameters:
a/w/s - Generator position
heading - Generator heading
p4 - Unknown (always 5.0)
p5 - Unknown (always 3.0)
modelHash - Vehicle model hash
p7/8/9/10 - Unknown (always -1)
p11 - Unknown (usually TRUE, only one instance of FALSE)
p12/13 - Unknown (always FALSE)
p14 - Unknown (usally FALSE, only two instances of TRUE)
p15 - Unknown (always TRUE)
p16 - Unknown (always -1)
Vector3 coords = GET_ENTITY_COORDS(PLAYER_PED_ID(), 0); CREATE_SCRIPT_VEHICLE_GENERATOR(coords.x, coords.y, coords.z, 1.0f, 5.0f, 3.0f, GET_HASH_KEY("adder"), -1. -1, -1, -1, -1, true, false, false, false, true, -1); staticcreateVehicle(modelHash:Int, x:Float, y:Float, z:Float, heading:Float, isNetwork:Bool, netMissionEntity:Bool):Dynamic
Creates a vehicle with the specified model at the specified position. This vehicle will initially be owned by the creating script as a mission entity, and the model should be loaded already (e.g. using REQUEST_MODEL).
NativeDB Added Parameter 8: BOOL p7staticdeleteAllTrains():Dynamic
staticdeleteMissionTrain(train:Dynamic):Dynamic
Used to delete mission trains created with CREATE_MISSION_TRAIN.
staticdeleteScriptVehicleGenerator(vehicleGenerator:Int):Dynamic
Removes a scripted vehicle generator.
staticdeleteVehicle(vehicle:Dynamic):Dynamic
Deletes a vehicle.
The vehicle must be a mission entity to delete, so call this before deleting: SET_ENTITY_AS_MISSION_ENTITY(vehicle, true, true);
eg how to use:
SET_ENTITY_AS_MISSION_ENTITY(vehicle, true, true);
DELETE_VEHICLE(&vehicle);
Deletes the specified vehicle, then sets the handle pointed to by the pointer to NULL. staticdetachContainerFromHandlerFrame(vehicle:Dynamic):Dynamic
staticdetachEntityFromCargobob(vehicle:Dynamic, entity:Dynamic):Dynamic
Detaches the specified entity currently being carried by a Cargobob.
staticdetachVehicleFromAnyCargobob(vehicle:Dynamic):Bool
staticdetachVehicleFromAnyTowTruck(vehicle:Dynamic):Bool
staticdetachVehicleFromCargobob(cargobob:Dynamic, vehicle:Dynamic):Dynamic
staticdetachVehicleFromTowTruck(towTruck:Dynamic, vehicle:Dynamic):Dynamic
First two parameters swapped. Scripts verify that towTruck is the first parameter, not the second. staticdetachVehicleFromTrailer(vehicle:Dynamic):Dynamic
staticdetonateVehiclePhoneExplosiveDevice():Dynamic
staticdisableIndividualPlanePropeller(vehicle:Dynamic, propeller:Int):Dynamic
staticdisablePlaneAileron(vehicle:Dynamic, p1:Bool, p2:Bool):Dynamic
staticdisableVehicleWeapon(disabled:Bool, weaponHash:Int, vehicle:Dynamic, owner:Dynamic):Dynamic
how does this work? staticdoesCargobobHavePickUpRope(cargobob:Dynamic):Bool
Returns true only when the hook is active, will return false if the magnet is active staticdoesCargobobHavePickupMagnet(cargobob:Dynamic):Bool
Returns true only when the magnet is active, will return false if the hook is active staticdoesScriptVehicleGeneratorExist(vehicleGenerator:Int):Bool
staticdoesVehicleExistWithDecorator(decorator:String):Bool
staticdoesVehicleHaveRoof(vehicle:Dynamic):Bool
Determines whether a specific vehicle is equipped with a roof.
NativeDB Introduced: v323staticdoesVehicleHaveSearchlight(vehicle:Dynamic):Bool
Determines whether the specified vehicle is equipped with a searchlight.
NativeDB Introduced: v2189staticdoesVehicleHaveStuckVehicleCheck(vehicle:Dynamic):Bool
Maximum amount of vehicles with vehicle stuck check appears to be 16. staticdoesVehicleHaveWeapons(vehicle:Dynamic):Bool
staticexplodeVehicle(vehicle:Dynamic, isAudible:Bool, isInvisible:Bool):Dynamic
Explodes a selected vehicle.
Vehicle vehicle = Vehicle you want to explode.
BOOL isAudible = If explosion makes a sound.
BOOL isInvisible = If the explosion is invisible or not.
First BOOL does not give any visual explosion, the vehicle just falls apart completely but slowly and starts to burn. staticexplodeVehicleInCutscene(vehicle:Dynamic, p1:Bool):Dynamic
staticfixVehicleWindow(vehicle:Dynamic, windowIndex:Int):Dynamic
See eWindowId declared in IS_VEHICLE_WINDOW_INTACT.
This function is coded to not work on vehicles of type: CBike, Bmx, CBoat, CTrain, and CSubmarine.
staticforcePlaybackRecordedVehicleUpdate(vehicle:Dynamic, p1:Bool):Dynamic
Often called after START_PLAYBACK_RECORDED_VEHICLE and SKIP_TIME_IN_PLAYBACK_RECORDED_VEHICLE; similar in use to FORCE_ENTITY_AI_AND_ANIMATION_UPDATE.staticforceSubmarineNeurtalBuoyancy(submarine:Dynamic, time:Int):Dynamic
Forces a submarine to maintain neutral buoyancy for a specified duration, preventing it from rising when unoccupied or without a driver.
NativeDB Introduced: v2189staticforceSubmarineSurfaceMode(vehicle:Dynamic, toggle:Bool):Dynamic
staticfullyChargeNitrous(vehicle:Dynamic):Dynamic
NativeDB Introduced: v3095
Recharges the nitrous system of the specified vehicle to its maximum capacity. This action sets the nitrous charge duration to the maximum limit defined by previous settings applied through SET_OVERRIDE_NITROUS_LEVEL.
staticgetBoatBoomPositionRatio(vehicle:Dynamic):Float
staticgetBoatVehicleModelAgility(modelHash:Int):Float
Retrieves the agility for a specific boat model, including any vehicle mods. Unlike other vehicles where Rockstar Games typically assess performance based on traction, boats use agility as a measure. This static value is distinct from the traction metrics used for other vehicle types.
NativeDB Introduced: v323staticgetClosestVehicle(x:Float, y:Float, z:Float, radius:Float, modelHash:Int, flags:Int):Dynamic
Example usage
VEHICLE::GET_CLOSEST_VEHICLE(x, y, z, radius, hash, unknown leave at 70)
x, y, z: Position to get closest vehicle to.
radius: Max radius to get a vehicle.
modelHash: Limit to vehicles with this model. 0 for any.
flags: The bitwise flags altering the function's behaviour.
Does not return police cars or helicopters.
It seems to return police cars for me, does not seem to return helicopters, planes or boats for some reason
Only returns non police cars and motorbikes with the flag set to 70 and modelHash to 0. ModelHash seems to always be 0 when not a modelHash in the scripts, as stated above.
These flags were found in the b617d scripts: 0,2,4,6,7,23,127,260,2146,2175,12294,16384,16386,20503,32768,67590,67711,98309,100359.
Converted to binary, each bit probably represents a flag as explained regarding another native here: gtaforums.com/topic/822314-guide-driving-styles
Conversion of found flags to binary: pastebin.com/kghNFkRi
At exactly 16384 which is 0100000000000000 in binary and 4000 in hexadecimal only planes are returned.
It's probably more convenient to use worldGetAllVehicles(int *arr, int arrSize) and check the shortest distance yourself and sort if you want by checking the vehicle type with for example VEHICLE::IS_THIS_MODEL_A_BOAT
-------------------------------------------------------------------------
Conclusion: This native is not worth trying to use. Use something like this instead: pastebin.com/xiFdXa7h
Use flag 127 to return police carsstaticgetConvertibleRoofState(vehicle:Dynamic):Int
Returns the convertible state of the specified vehicle.
enum eRoofState {
RAISED = 0,
LOWERING = 1,
LOWERED = 2,
RAISING = 3,
CLOSING_BOOT = 4,
ROOF_STUCK_RAISED = 5,
ROOF_STUCK_LOWERED = 6
}staticgetCurrentPlaybackForVehicle(vehicle:Dynamic):Int
staticgetDisplayNameFromVehicleModel(modelHash:Int):String
Returns the display name/text label (gameName in vehicles.meta) for the specified vehicle model.
staticgetEntityAttachedToTowTruck(towTruck:Dynamic):Dynamic
staticgetHeliTailBoomHealth(vehicle:Dynamic):Float
Max 1000.
At -100 both helicopter rotors will stall.staticgetIsBoatCapsized(vehicle:Dynamic):Bool
Checks whether the specified boat vehicle is capsized, meaning it has overturned or is upside down in the water.
staticgetIsLeftVehicleHeadlightDamaged(vehicle:Dynamic):Bool
From the driver's perspective, is the left headlight broken. staticgetIsRightVehicleHeadlightDamaged(vehicle:Dynamic):Bool
From the driver's perspective, is the right headlight broken. staticgetIsVehicleEngineRunning(vehicle:Dynamic):Bool
Returns true when in a vehicle, false whilst entering/exiting. staticgetIsVehiclePrimaryColourCustom(vehicle:Dynamic):Bool
staticgetIsVehicleSecondaryColourCustom(vehicle:Dynamic):Bool
Check if Vehicle Secondary is avaliable for customize staticgetLandingGearState(vehicle:Dynamic):Int
Landing gear states:
0: Deployed
1: Closing (Retracting)
3: Opening (Deploying)
4: Retracted
5: Broken
Landing gear state 2 is never used.
staticgetLastDrivenVehicle():Dynamic
staticgetLastPedInVehicleSeat(vehicle:Dynamic, seatIndex:Int):Dynamic
staticgetLiveryName(vehicle:Dynamic, liveryIndex:Int):String
Second Param = LiveryIndex
example
int count = VEHICLE::GET_VEHICLE_LIVERY_COUNT(veh);
for (int i = 0; i < count; i++)
{
char* LiveryName = VEHICLE::GET_LIVERY_NAME(veh, i);
}
this example will work fine to fetch all names
for example for Sanchez we get
SANC_LV1
SANC_LV2
SANC_LV3
SANC_LV4
SANC_LV5
Use _GET_LABEL_TEXT, to get the localized livery name.
-----------
NOTE: You may need to set the vehicle's modKit to 0 by using this function: SET_VEHICLE_MOD_KIT() before getting the name, otherwise this native may return NULL.
dev-c.com/nativedb/func/info/1f2aa07f00b3217a staticgetMakeNameFromVehicleModel(modelHash:Int):String
Retrieves the manufacturer's name for a specified vehicle.
NativeDB Introduced: v1868staticgetModSlotName(vehicle:Dynamic, modType:Int):String
staticgetModTextLabel(vehicle:Dynamic, modType:Int, modValue:Int):String
Returns the text label of a mod type for a given vehicle
Use _GET_LABEL_TEXT to get the part name in the game's language staticgetNumModColors(paintType:Int, p1:Bool):Int
paintType:
0: Normal
1: Metallic
2: Pearl
3: Matte
4: Metal
5: ChromestaticgetNumModKits(vehicle:Dynamic):Int
staticgetNumVehicleMods(vehicle:Dynamic, modType:Int):Int
Returns how many possible mods a vehicle has for a given mod type staticgetNumVehicleWindowTints():Int
staticgetNumberOfVehicleNumberPlates():Int
Returns the number of *types* of licence plates, enumerated below in SET_VEHICLE_NUMBER_PLATE_TEXT_INDEX. staticgetPedInVehicleSeat(vehicle:Dynamic, seatIndex:Int):Dynamic
Gets the ped in the specified seat of the passed vehicle.
If there is no ped in the seat, and the game considers the vehicle as ambient population, this will create a random occupant ped in the seat, which may be cleaned up by the game fairly soon if not marked as script-owned mission entity.
NativeDB Added Parameter 3: BOOL p2 (uses a different GetOccupant function)
staticgetPedUsingVehicleDoor(vehicle:Dynamic, doorIndex:Int):Dynamic
See eDoorId declared in SET_VEHICLE_DOOR_SHUT
staticgetPositionInRecording(vehicle:Dynamic):Float
Distance traveled in the vehicles current recording.staticgetPositionOfVehicleRecordingAtTime(recording:Int, time:Float, script:String):Dynamic
This native does no interpolation between pathpoints. The same position will be returned for all times up to the next pathpoint in the recording.
staticgetPositionOfVehicleRecordingIdAtTime(id:Int, time:Float):Dynamic
staticgetRandomVehicleBackBumperInSphere(p0:Float, p1:Float, p2:Float, p3:Float, p4:Int, p5:Int, p6:Int):Dynamic
staticgetRandomVehicleFrontBumperInSphere(p0:Float, p1:Float, p2:Float, p3:Float, p4:Int, p5:Int, p6:Int):Dynamic
staticgetRandomVehicleInSphere(x:Float, y:Float, z:Float, radius:Float, modelHash:Int, flags:Int):Dynamic
Gets a random vehicle in a sphere at the specified position, of the specified radius.
x: The X-component of the position of the sphere.
y: The Y-component of the position of the sphere.
z: The Z-component of the position of the sphere.
radius: The radius of the sphere. Max is 9999.9004.
modelHash: The vehicle model to limit the selection to. Pass 0 for any model.
flags: The bitwise flags that modifies the behaviour of this function. staticgetRandomVehicleModelInMemory(p0:Bool, modelHash:Dynamic, successIndicator:Dynamic):Dynamic
Not present in the retail version! It's just a nullsub.
p0 always true (except in one case)
p1 a random vehicle hash loaded in memory
successIndicator: 0 if success, -1 if failedstaticgetRotationOfVehicleRecordingAtTime(recording:Int, time:Float, script:String):Dynamic
staticgetRotationOfVehicleRecordingIdAtTime(id:Int, time:Float):Dynamic
staticgetSubmarineIsUnderDesignDepth(submarine:Dynamic):Bool
Determines if the submarine is operating below its designated crush depth.
NativeDB Introduced: v2189staticgetSubmarineNumberOfAirLeaks(submarine:Dynamic):Int
Checks if a Submarine has any air leaks, when there is more than 4 the player will drown.
NativeDB Introduced: v2189staticgetTimePositionInRecording(vehicle:Dynamic):Float
Can be used with GET_TOTAL_DURATION_OF_VEHICLE_RECORDING{_ID} to compute a percentage.staticgetTotalDurationOfVehicleRecording(recording:Int, script:String):Float
staticgetTotalDurationOfVehicleRecordingId(id:Int):Float
staticgetTrainCarriage(train:Dynamic, trailerNumber:Int):Dynamic
Corrected p1. it's basically the 'carriage/trailer number'. So if the train has 3 trailers you'd call the native once with a var or 3 times with 1, 2, 3. staticgetVehicleAcceleration(vehicle:Dynamic):Float
Retrieves a static value representing the maximum drive force of specific a vehicle, including any vehicle mods. This value does not change dynamically during gameplay. This value provides an approximation and should be considered alongside other performance metrics like top speed for a more comprehensive understanding of the vehicle's capabilities.
NativeDB Introduced: v323staticgetVehicleAttachedToCargobob(cargobob:Dynamic):Dynamic
Returns attached vehicle (Vehicle in parameter must be cargobob) staticgetVehicleBodyHealth(vehicle:Dynamic):Float
Seems related to vehicle health, like the one in IV.
Max 1000, min 0.
Vehicle does not necessarily explode or become undrivable at 0. staticgetVehicleCauseOfDestruction(vehicle:Dynamic):Int
staticgetVehicleClass(vehicle:Dynamic):Int
Returns an int
Vehicle Classes:
0: Compacts
1: Sedans
2: SUVs
3: Coupes
4: Muscle
5: Sports Classics
6: Sports
7: Super
8: Motorcycles
9: Off-road
10: Industrial
11: Utility
12: Vans
13: Cycles
14: Boats
15: Helicopters
16: Planes
17: Service
18: Emergency
19: Military
20: Commercial
21: Trains
22: Open Wheel
char buffer[128];
std::sprintf(buffer, "VEH_CLASS_%i", VEHICLE::GET_VEHICLE_CLASS(vehicle));
char* className = UI::_GET_LABEL_TEXT(buffer); staticgetVehicleClassEstimatedMaxSpeed(vehicleClass:Int):Float
staticgetVehicleClassFromName(modelHash:Int):Int
For a full enum, see here : pastebin.com/i2GGAjY0
char buffer[128];
std::sprintf(buffer, "VEH_CLASS_%i", VEHICLE::GET_VEHICLE_CLASS_FROM_NAME (hash));
const char* className = HUD::_GET_LABEL_TEXT(buffer);staticgetVehicleClassMaxAcceleration(vehicleClass:Int):Float
staticgetVehicleClassMaxAgility(vehicleClass:Int):Float
staticgetVehicleClassMaxBraking(vehicleClass:Int):Float
staticgetVehicleClassMaxTraction(vehicleClass:Int):Float
staticgetVehicleColor(vehicle:Dynamic, r:Dynamic, g:Dynamic, b:Dynamic):Dynamic
staticgetVehicleColourCombination(vehicle:Dynamic):Int
staticgetVehicleColours(vehicle:Dynamic, colorPrimary:Dynamic, colorSecondary:Dynamic):Dynamic
staticgetVehicleCustomPrimaryColour(vehicle:Dynamic, r:Dynamic, g:Dynamic, b:Dynamic):Dynamic
staticgetVehicleCustomSecondaryColour(vehicle:Dynamic, r:Dynamic, g:Dynamic, b:Dynamic):Dynamic
staticgetVehicleDeformationAtPos(vehicle:Dynamic, offsetX:Float, offsetY:Float, offsetZ:Float):Dynamic
The only example I can find of this function in the scripts, is this:
struct _s = VEHICLE::GET_VEHICLE_DEFORMATION_AT_POS(rPtr((A_0) + 4), 1.21f, 6.15f, 0.3f);
-----------------------------------------------------------------------------------------------------------------------------------------
PC scripts:
v_5/ *{3}* / = VEHICLE::GET_VEHICLE_DEFORMATION_AT_POS(a_0._f1, 1.21, 6.15, 0.3); staticgetVehicleDoorAngleRatio(vehicle:Dynamic, doorIndex:Int):Float
Checks the angle of the door mapped from 0.0 - 1.0 where 0.0 is fully closed and 1.0 is fully open.
See eDoorId declared in SET_VEHICLE_DOOR_SHUT
staticgetVehicleDoorLockStatus(vehicle:Dynamic):Int
staticgetVehicleDoorsLockedForPlayer(vehicle:Dynamic, player:Dynamic):Bool
staticgetVehicleEngineHealth(vehicle:Dynamic):Float
Returns 1000.0 if the function is unable to get the address of the specified vehicle or if it's not a vehicle.
Minimum: -4000
Maximum: 1000
-4000: Engine is destroyed
0 and below: Engine catches fire and health rapidly declines
300: Engine is smoking and losing functionality
1000: Engine is perfect staticgetVehicleEnveffScale(vehicle:Dynamic):Float
formerly known as _GET_VEHICLE_PAINT_FADE
The result is a value from 0-1, where 0 is fresh paint.staticgetVehicleEstimatedMaxSpeed(vehicle:Dynamic):Float
Retrieves a static value representing the estimated max speed of a specific vehicle, including any vehicle mods. This value does not change dynamically during gameplay.
NativeDB Introduced: v323staticgetVehicleExtraColours(vehicle:Dynamic, pearlescentColor:Dynamic, wheelColor:Dynamic):Dynamic
staticgetVehicleFlightNozzlePosition(aircraft:Dynamic):Float
staticgetVehicleHasKers(vehicle:Dynamic):Bool
staticgetVehicleHealthPercentage(vehicle:Dynamic):Float
NativeDB Added Parameter 2: float maxEngineHealth
NativeDB Added Parameter 3: float maxPetrolTankHealth
NativeDB Added Parameter 4: float maxBodyHealth
NativeDB Added Parameter 5: float maxMainRotorHealth
NativeDB Added Parameter 6: float maxTailRotorHealth
NativeDB Added Parameter 7: float maxUnkHealthstaticgetVehicleHomingLockonState(vehicle:Dynamic):Int
Returns a value depending on the lock-on state of vehicle weapons.
0: not locked on
1: locking on
2: locked onstaticgetVehicleIndividualDoorLockStatus(vehicle:Dynamic, doorIndex:Int):Int
See eDoorId declared in SET_VEHICLE_DOOR_SHUT
staticgetVehicleIsMercenary(vehicle:Dynamic):Bool
Returns whether the specified vehicle is designated as a mercenary vehicle
staticgetVehicleLayoutHash(vehicle:Dynamic):Int
staticgetVehicleLightsState(vehicle:Dynamic, lightsOn:Dynamic, highbeamsOn:Dynamic):Bool
staticgetVehicleLockOnTarget(vehicle:Dynamic, entity:Dynamic):Bool
staticgetVehicleMaxBraking(vehicle:Dynamic):Float
staticgetVehicleMaxNumberOfPassengers(vehicle:Dynamic):Int
staticgetVehicleMaxTraction(vehicle:Dynamic):Float
staticgetVehicleMod(vehicle:Dynamic, modType:Int):Int
staticgetVehicleModColor1(vehicle:Dynamic, paintType:Dynamic, color:Dynamic, pearlescentColor:Dynamic):Dynamic
staticgetVehicleModColor1Name(vehicle:Dynamic, p1:Bool):String
returns a string which is the codename of the vehicle's currently selected primary color
p1 is always 0 staticgetVehicleModColor2(vehicle:Dynamic, paintType:Dynamic, color:Dynamic):Dynamic
staticgetVehicleModColor2Name(vehicle:Dynamic):String
returns a string which is the codename of the vehicle's currently selected secondary color staticgetVehicleModIdentifierHash(vehicle:Dynamic, modType:Int, modIndex:Int):Int
Can be used for IS_DLC_VEHICLE_MOD and _0xC098810437312FFFstaticgetVehicleModKit(vehicle:Dynamic):Int
staticgetVehicleModKitType(vehicle:Dynamic):Int
staticgetVehicleModModifierValue(vehicle:Dynamic, modType:Int, modIndex:Int):Int
staticgetVehicleModVariation(vehicle:Dynamic, modType:Int):Bool
Only used for wheels(ModType = 23/24) Returns true if the wheels are custom wheelsstaticgetVehicleModelAcceleration(modelHash:Int):Float
Returns the acceleration of the specified model.
staticgetVehicleModelEstimatedMaxSpeed(modelHash:Int):Float
Returns max speed (without mods) of the specified vehicle model in m/s.staticgetVehicleModelMaxBraking(modelHash:Int):Float
Returns max braking of the specified vehicle model.staticgetVehicleModelMaxBrakingMaxMods(modelHash:Int):Float
staticgetVehicleModelMaxTraction(modelHash:Int):Float
Returns max traction of the specified vehicle model.staticgetVehicleModelNumberOfSeats(modelHash:Int):Int
Returns max number of passengers (including the driver) for the specified vehicle model.staticgetVehicleModelValue(vehicleModel:Int):Int
Returns `nMonetaryValue` from handling.meta for specific model, which is the vehicle's monetary value.staticgetVehicleNumberOfPassengers(vehicle:Dynamic):Int
Gets the number of passengers, NOT including the driver. Use IS_VEHICLE_SEAT_FREE(Vehicle, -1) to also check for the driver staticgetVehicleNumberPlateText(vehicle:Dynamic):String
Returns the license plate text from a vehicle. 8 chars maximum. staticgetVehicleNumberPlateTextIndex(vehicle:Dynamic):Int
enum eVehiclePlateIndicies {
SanAndreasCursive = 0,
SanAndreasBlack = 1,
SanAndreasBlue = 2,
SanAndreasPlain = 3,
SRExcept = 4,
NorthYankton = 5,
// All indicies below this require b3095
ECola = 6,
LasVenturas = 7,
LiberyCity = 8,
LSCarMeet = 9,
LSPanic = 10,
LSPounders = 11,
Sprunk = 12,
}staticgetVehiclePetrolTankHealth(vehicle:Dynamic):Float
1000 is max health
Begins leaking gas at around 650 health staticgetVehiclePlateType(vehicle:Dynamic):Int
Returns the plates a vehicle has.
enum eVehiclePlateType
{
VPT_FRONT_AND_BACK_PLATES = 0,
VPT_FRONT_PLATES = 1,
VPT_BACK_PLATES = 2,
VPT_NONE = 3,
};
Motorcycles with no visible plates will sometimes return a 2 for unknown reasons.
staticgetVehicleTrailerVehicle(vehicle:Dynamic, trailer:Dynamic):Bool
Gets the trailer of a vehicle and puts it into the trailer parameter. staticgetVehicleTyreSmokeColor(vehicle:Dynamic, r:Dynamic, g:Dynamic, b:Dynamic):Dynamic
staticgetVehicleTyresCanBurst(vehicle:Dynamic):Bool
staticgetVehicleWheelType(vehicle:Dynamic):Int
enum eVehicleWheelType
{
VWT_SPORT = 0,
VWT_MUSCLE = 1,
VWT_LOWRIDER = 2,
VWT_SUV = 3,
VWT_OFFROAD = 4,
VWT_TUNER = 5,
VWT_BIKE = 6,
VWT_HIEND = 7,
// Benny's Original
VWT_SUPERMOD1 = 8,
// Benny's Bespoke
VWT_SUPERMOD2 = 9,
// Open Wheel
VWT_SUPERMOD3 = 10,
// Street
VWT_SUPERMOD4 = 11,
// Track
VWT_SUPERMOD5 = 12,
};staticgetVehicleWindowTint(vehicle:Dynamic):Int
statichasPreloadModsFinished(p0:Dynamic):Bool
statichasVehicleAssetLoaded(vehicleAsset:Int):Bool
statichasVehiclePhoneExplosiveDevice():Bool
statichasVehicleRecordingBeenLoaded(recording:Int, script:String):Bool
statichaveVehicleModsStreamedIn(vehicle:Dynamic):Bool
staticinstantlyFillVehiclePopulation():Dynamic
staticisAnyEntityAttachedToHandlerFrame(vehicle:Dynamic):Bool
staticisAnyPedRappellingFromHeli(vehicle:Dynamic):Bool
staticisAnyVehicleNearPoint(x:Float, y:Float, z:Float, radius:Float):Bool
staticisBigVehicle(vehicle:Dynamic):Bool
staticisBoatAnchored(boat:Dynamic):Bool
Checks if a boat is currently anchored.
This native is a getter for SET_BOAT_ANCHOR.
NativeDB Introduced: v573staticisCopVehicleInArea3D(x1:Float, x2:Float, y1:Float, y2:Float, z1:Float, z2:Float):Bool
Usage:
public bool isCopInRange(Vector3 Location, float Range)
{
return Function.Call<bool>(Hash.IS_COP_PED_IN_AREA_3D, Location.X - Range, Location.Y - Range, Location.Z - Range, Location.X + Range, Location.Y + Range, Location.Z + Range);
} staticisEntityAttachedToHandlerFrame(vehicle:Dynamic, entity:Dynamic):Bool
staticisHeliLandingAreaBlocked(vehicle:Dynamic):Bool
staticisHeliPartBroken(vehicle:Dynamic, p1:Bool, p2:Bool, p3:Bool):Bool
staticisNitrousActive(vehicle:Dynamic):Bool
NativeDB Introduced: 3095
Determines if the nitrous is currently activated in the specified vehicle.
staticisPlaneLandingGearIntact(plane:Dynamic):Bool
staticisPlaybackGoingOnForVehicle(vehicle:Dynamic):Bool
staticisPlaybackUsingAiGoingOnForVehicle(vehicle:Dynamic):Bool
staticisSeatWarpOnly(vehicle:Dynamic, seatIndex:Int):Bool
staticisTaxiLightOn(vehicle:Dynamic):Bool
staticisThisModelABicycle(model:Int):Bool
staticisThisModelABike(model:Int):Bool
staticisThisModelABoat(model:Int):Bool
staticisThisModelACar(model:Int):Bool
To check if the model is an amphibious car, see gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page-33#entry1069317363 (for build 944 and above only!) staticisThisModelAHeli(model:Int):Bool
staticisThisModelAPlane(model:Int):Bool
staticisThisModelAQuadbike(model:Int):Bool
staticisThisModelATrain(model:Int):Bool
staticisToggleModOn(vehicle:Dynamic, modType:Int):Bool
staticisTurretSeat(vehicle:Dynamic, seatIndex:Int):Bool
staticisVehicleAConvertible(vehicle:Dynamic, checkRoofExtras:Bool):Bool
Determines if a vehicle is a convertible with an animatable roof. This native checks if the specified vehicle model features a convertible roof that can be lowered or raised through an animation.
NativeDB Introduced: v323staticisVehicleAlarmActivated(vehicle:Dynamic):Bool
staticisVehicleAttachedToCargobob(cargobob:Dynamic, vehicleAttached:Dynamic):Bool
staticisVehicleAttachedToTowTruck(towTruck:Dynamic, vehicle:Dynamic):Bool
Scripts verify that towTruck is the first parameter, not the second. staticisVehicleAttachedToTrailer(vehicle:Dynamic):Bool
staticisVehicleBumperBouncing(vehicle:Dynamic, frontBumper:Bool):Bool
staticisVehicleBumperBrokenOff(vehicle:Dynamic, front:Bool):Bool
staticisVehicleDoorDamaged(veh:Dynamic, doorID:Int):Bool
See eDoorId declared in SET_VEHICLE_DOOR_SHUT
staticisVehicleDoorFullyOpen(vehicle:Dynamic, doorIndex:Int):Bool
See eDoorId declared in SET_VEHICLE_DOOR_SHUT
staticisVehicleDriveable(vehicle:Dynamic, isOnFireCheck:Bool):Bool
p1 is always 0 in the scripts.
p1 = check if vehicle is on fire staticisVehicleExtraTurnedOn(vehicle:Dynamic, extraId:Int):Bool
staticisVehicleHighDetail(vehicle:Dynamic):Bool
staticisVehicleInBurnout(vehicle:Dynamic):Bool
Returns whether the specified vehicle is currently in a burnout.
vb.net
Public Function isVehicleInBurnout(vh As Vehicle) As Boolean
Return Native.Function.Call(Of Boolean)(Hash.IS_VEHICLE_IN_BURNOUT, vh)
End Function staticisVehicleInGarageArea(garageName:String, vehicle:Dynamic):Bool
garageName example "Michael - Beverly Hills"staticisVehicleModel(vehicle:Dynamic, model:Int):Bool
staticisVehicleOnAllWheels(vehicle:Dynamic):Bool
Public Function isVehicleOnAllWheels(vh As Vehicle) As Boolean
Return Native.Function.Call(Of Boolean)(Hash.IS_VEHICLE_ON_ALL_WHEELS, vh)
End Function staticisVehicleSearchlightOn(vehicle:Dynamic):Bool
Possibly: Returns whether the searchlight (found on police vehicles) is toggled on. staticisVehicleSeatFree(vehicle:Dynamic, seatIndex:Int):Bool
Seat indices range from -1 to GET_VEHICLE_MAX_NUMBER_OF_PASSENGERS minus one.
// CTaskExitVehicleSeat::eSeatPosition - 1
enum eSeatPosition
{
SF_FrontDriverSide = -1,
SF_FrontPassengerSide = 0,
SF_BackDriverSide = 1,
SF_BackPassengerSide = 2,
SF_AltFrontDriverSide = 3,
SF_AltFrontPassengerSide = 4,
SF_AltBackDriverSide = 5,
SF_AltBackPassengerSide = 6,
};
NativeDB Added Parameter 3: BOOL isTaskRunning
isTaskRunning = on true the function returns already false while a task on the target seat is running (TASK_ENTER_VEHICLE/TASK_SHUFFLE_TO_NEXT_VEHICLE_SEAT) - on false only when a ped is finally sitting in the seat.staticisVehicleSirenAudioOn(vehicle:Dynamic):Bool
staticisVehicleSprayable(vehicle:Dynamic):Bool
Returns false if the vehicle has the FLAG_NO_RESPRAY flag set.staticisVehicleStolen(vehicle:Dynamic):Bool
staticisVehicleStopped(vehicle:Dynamic):Bool
Returns true if the vehicle's current speed is less than, or equal to 0.0025f.
For some vehicles it returns true if the current speed is <= 0.00039999999.staticisVehicleStoppedAtTrafficLights(vehicle:Dynamic):Bool
This native checks if the given vehicle is stopped at a red or amber traffic light junction, provided the driver's personality is set to not run amber lights.
staticisVehicleStuckOnRoof(vehicle:Dynamic):Bool
staticisVehicleStuckTimerUp(vehicle:Dynamic, p1:Int, p2:Int):Bool
p1 can be anywhere from 0 to 3 in the scripts. p2 is generally somewhere in the 1000 to 10000 range. staticisVehicleTyreBurst(vehicle:Dynamic, wheelID:Int, isBurstToRim:Bool):Bool
enum eVehicleWheels
{
WHEEL_LF = 0, // Vehicle Left front
WHEEL_RF = 1, // Vehicle Right front
WHEEL_LM = 2, // Vehicle Left middle
WHEEL_RM = 3, // Vehicle Right middle
WHEEL_LR = 4, // Vehicle Left rear
WHEEL_RR = 5, // Vehicle Right rear
WHEEL_BF = 6, // Bike front
WHEEL_BR = 7, // Bike rear
MAX_WHEELS = 8
};staticisVehicleVisible(vehicle:Dynamic):Bool
staticisVehicleWindowIntact(vehicle:Dynamic, windowIndex:Int):Bool
enum eWindowId {
VEH_EXT_WINDOW_LF = 0,
VEH_EXT_WINDOW_RF = 1,
VEH_EXT_WINDOW_LR = 2,
VEH_EXT_WINDOW_RR = 3,
VEH_EXT_WINDOW_LM = 4,
VEH_EXT_WINDOW_RM = 5,
VEH_EXT_WINDSCREEN = 6,
VEH_EXT_WINDSCREEN_R = 7,
}staticlowerConvertibleRoof(vehicle:Dynamic, instantlyLower:Bool):Dynamic
Lowers the roof on a convertible vehicle, utilizing any available animations for the action. This native is particularly useful for creating a realistic interaction with convertible vehicles by animating the process of lowering the roof.
You can check if the vehicle has an convertible roof using IS_VEHICLE_A_CONVERTIBLE.
NativeDB Introduced: v323staticmodifyVehicleTopSpeed(vehicle:Dynamic, value:Float):Dynamic
staticopenBombBayDoors(vehicle:Dynamic):Dynamic
staticpausePlaybackRecordedVehicle(vehicle:Dynamic):Dynamic
staticpreloadVehicleMod(p0:Dynamic, modType:Int, p2:Dynamic):Dynamic
staticraiseConvertibleRoof(vehicle:Dynamic, instantlyRaise:Bool):Dynamic
Raises the roof on a convertible vehicle, utilizing any available animations for the action. This native is particularly useful for creating a realistic interaction with convertible vehicles by animating the process of raising the roof.
You can check if the vehicle has an convertible roof using IS_VEHICLE_A_CONVERTIBLE.
To lower the convertible roof, you can use LOWER_CONVERTIBLE_ROOF.
NativeDB Introduced: v323staticreleasePreloadMods(vehicle:Dynamic):Dynamic
staticremovePickUpRopeForCargobob(cargobob:Dynamic):Dynamic
Retracts the hook on the cargobob.
Note: after you retract it the natives for dropping the hook no longer work staticremoveRoadNodeSpeedZone(speedzone:Int):Bool
staticremoveVehicleAsset(vehicleAsset:Int):Dynamic
staticremoveVehicleCombatAvoidanceArea(p0:Dynamic):Dynamic
staticremoveVehicleHighDetailModel(vehicle:Dynamic):Dynamic
staticremoveVehicleMod(vehicle:Dynamic, modType:Int):Dynamic
staticremoveVehicleStuckCheck(vehicle:Dynamic):Dynamic
staticremoveVehicleUpsidedownCheck(vehicle:Dynamic):Dynamic
staticremoveVehicleWindow(vehicle:Dynamic, windowIndex:Int):Dynamic
See eWindowId declared in IS_VEHICLE_WINDOW_INTACT.
staticremoveVehiclesFromGeneratorsInArea(x1:Float, y1:Float, z1:Float, x2:Float, y2:Float, z2:Float, unk:Dynamic):Dynamic
staticrequestVehicleAsset(vehicleHash:Int, vehicleAsset:Int):Dynamic
REQUEST_VEHICLE_ASSET(GET_HASH_KEY(cargobob3), 3);
vehicle found that have asset's:
cargobob3
submersible
blazer staticrequestVehicleHighDetailModel(vehicle:Dynamic):Dynamic
staticrequestVehicleRecording(recording:Int, script:String):Dynamic
Request the vehicle recording defined by the lowercase format string "%s%03d.yvr". For example, REQUEST_VEHICLE_RECORDING(1, "FBIs1UBER") corresponds to fbis1uber001.yvr.
For all vehicle recording/playback natives, "script" is a common prefix that usually corresponds to the script/mission the recording is used in, "recording" is its int suffix, and "id" (e.g., in native GET_TOTAL_DURATION_OF_VEHICLE_RECORDING_ID) corresponds to a unique identifier within the recording streaming module.
Note that only 24 recordings (hardcoded in multiple places) can ever active at a given time before clobbering begins.staticresetVehicleStuckTimer(vehicle:Dynamic, nullAttributes:Int):Dynamic
The inner function has a switch on the second parameter. It's the stuck timer index.
Here's some pseudo code I wrote for the inner function:
void __fastcall NATIVE_RESET_VEHICLE_STUCK_TIMER_INNER(CUnknown* unknownClassInVehicle, int timerIndex)
{
switch (timerIndex)
{
case 0:
unknownClassInVehicle->FirstStuckTimer = (WORD)0u;
case 1:
unknownClassInVehicle->SecondStuckTimer = (WORD)0u;
case 2:
unknownClassInVehicle->ThirdStuckTimer = (WORD)0u;
case 3:
unknownClassInVehicle->FourthStuckTimer = (WORD)0u;
case 4:
unknownClassInVehicle->FirstStuckTimer = (WORD)0u;
unknownClassInVehicle->SecondStuckTimer = (WORD)0u;
unknownClassInVehicle->ThirdStuckTimer = (WORD)0u;
unknownClassInVehicle->FourthStuckTimer = (WORD)0u;
break;
};
} staticresetVehicleWheels(vehicle:Dynamic, toggle:Bool):Dynamic
staticrollDownWindow(vehicle:Dynamic, windowIndex:Int):Dynamic
See eWindowId declared in IS_VEHICLE_WINDOW_INTACT.
staticrollDownWindows(vehicle:Dynamic):Dynamic
Roll down all the windows of the vehicle passed through the first parameter. staticrollUpWindow(vehicle:Dynamic, windowIndex:Int):Dynamic
See eWindowId declared in IS_VEHICLE_WINDOW_INTACT.
staticsetAllLowPriorityVehicleGeneratorsActive(active:Bool):Dynamic
staticsetAllVehicleGeneratorsActive():Dynamic
staticsetAllVehicleGeneratorsActiveInArea(x1:Float, y1:Float, z1:Float, x2:Float, y2:Float, z2:Float, p6:Bool, p7:Bool):Dynamic
staticsetAmbientVehicleRangeMultiplierThisFrame(range:Float):Dynamic
staticsetBikeOnStand(vehicle:Dynamic, x:Float, y:Float):Dynamic
Only works on bikes, both X and Y work in the -1 - 1 range.
X forces the bike to turn left or right (-1, 1)
Y forces the bike to lean to the left or to the right (-1, 1)
Example with X -1/Y 1
http://i.imgur.com/TgIuAPJ.jpgstaticsetBoatAnchor(boat:Dynamic, toggle:Bool):Dynamic
Sets the anchor state for a boat.
NativeDB Introduced: v323
Note: You might want to check if you can use your anchor before with CAN_ANCHOR_BOAT_HERE.
staticsetBoatDisableAvoidance(vehicle:Dynamic, p1:Bool):Dynamic
staticsetBoatLowLodAnchorDistance(boat:Dynamic, value:Float):Dynamic
Sets the distance from the player at which anchored boats switch between high and low LOD (Level of Detail) buoyancy mode.
NativeDB Introduced: v323staticsetBoatRemainsAnchoredWhilePlayerIsDriver(boat:Dynamic, toggle:Bool):Dynamic
Sets whether a boat should remain anchored even when a player is driving it.
Note: This native is always used with SET_BOAT_ANCHOR.
NativeDB Introduced: v323staticsetBoatSinksWhenWrecked(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetCanResprayVehicle(vehicle:Dynamic, state:Bool):Dynamic
Hardcoded to not work in multiplayer. staticsetCarBootOpen(vehicle:Dynamic):Dynamic
staticsetCargobobExcludeFromPickupEntity(cargobob:Dynamic, entity:Dynamic):Dynamic
Prevents a specified entity from being detached from a Cargobob, even in the event of collisions.
staticsetCargobobForceDontDetachVehicle(cargobob:Dynamic, toggle:Bool):Dynamic
Stops cargobob from being able to detach the attached vehicle.
staticsetCargobobPickupMagnetActive(cargobob:Dynamic, isActive:Bool):Dynamic
Won't attract or magnetize to any helicopters or planes of course, but that's common sense. staticsetCargobobPickupMagnetEffectRadius(vehicle:Dynamic, p1:Float):Dynamic
staticsetCargobobPickupMagnetFalloff(vehicle:Dynamic, p1:Float):Dynamic
staticsetCargobobPickupMagnetPullRopeLength(cargobob:Dynamic, p1:Float):Dynamic
staticsetCargobobPickupMagnetPullStrength(cargobob:Dynamic, p1:Float):Dynamic
staticsetCargobobPickupMagnetReducedFalloff(cargobob:Dynamic, p1:Float):Dynamic
staticsetCargobobPickupMagnetReducedStrength(cargobob:Dynamic, vehicle:Dynamic):Dynamic
staticsetCargobobPickupMagnetStrength(cargobob:Dynamic, strength:Float):Dynamic
staticsetCargobobPickupRopeDampingMultiplier(cargobob:Dynamic, p1:Float):Dynamic
staticsetCargobobPickupRopeType(vehicle:Dynamic, state:Int):Dynamic
staticsetConvertibleRoof(vehicle:Dynamic, toggle:Bool):Dynamic
Enables or disables the convertible roof on vehicles that support old-style GTA IV roofs, which are not animated. Setting toggle to true will apply the roof to the vehicle, and setting it to false will remove the roof, assuming the vehicle has versions with and without a roof.
If you want to lock or unlock the roof mechanism, use SET_CONVERTIBLE_ROOF_LATCH_STATE.
You can check if the vehicle has a roof with DOES_VEHICLE_HAVE_ROOF.
NativeDB Introduced: v323
Vehicles with both roofed and roofless versions (others may exist; this list is compiled from decompiled scripts).
- chino
- voltic
- buccaneer
- buccaneer2
- chino2
- faction
- faction2
- mamba
staticsetConvertibleRoofLatchState(vehicle:Dynamic, bLatched:Bool):Dynamic
This native is used to latch or unlatch the convertible roof of a vehicle. It allows for direct control over the roof's mechanism without actually opening or closing the roof. This can be useful for scenarios where you need to prepare a vehicle's roof to be opened or closed by another action or to ensure it remains fixed in its current state regardless of other interactions.
NativeDB Introduced: v323staticsetDisableBmxExtraTrickForces(disableExtraTrickForces:Bool):Dynamic
Disables the additional physics forces applied to BMX bikes that enable them to perform tricks.
NativeDB Introduced: v463staticsetDisableExplodeFromBodyDamageOnCollision(vehicle:Dynamic, disableExplode:Bool):Dynamic
Prevents a vehicle from exploding upon sustaining body damage from physical collisions. This can be used to increase the durability of vehicles in high-impact scenarios, such as races or combat situations, by preventing them from being destroyed due to collision-induced body damage.
For helicopters, you might want to check SET_DISABLE_HELI_EXPLODE_FROM_BODY_DAMAGE instead.
NativeDB Introduced: v1290staticsetDisableHeliExplodeFromBodyDamage(helicopter:Dynamic, disableExplode:Bool):Dynamic
Prevents a helicopter from exploding due to relatively minor body damage.
NativeDB Introduced: v1103staticsetDisableHoverModeFlight(vehicle:Dynamic, toggle:Bool):Dynamic
Disables wings for Deluxo and Oppressor MK II. For the Deluxo, it retracts the wings immediately, preventing flight. For the Oppressor Mk II, the wings retract after landing and take-off is not possible, though it can still glide if launched into the air.
staticsetDisablePretendOccupants(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetDisableRandomTrainsThisFrame(toggle:Bool):Dynamic
staticsetDisableVehicleEngineFires(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetDisableVehiclePetrolTankDamage(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetDisableVehiclePetrolTankFires(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetDistantCarsEnabled(toggle:Bool):Dynamic
Toggles to render distant vehicles. They may not be vehicles but images to look like vehicles. staticsetFarDrawVehicles(toggle:Bool):Dynamic
staticsetForceHdVehicle(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetForceLowLodAnchorMode(boat:Dynamic, toggle:Bool):Dynamic
Sets whether a boat should remain in the non-physical, low LOD anchor mode even when a player is driving it.
Note: This native requires SET_BOAT_REMAINS_ANCHORED_WHILE_PLAYER_IS_DRIVER to be set to true to work properly.
NativeDB Introduced: v323staticsetForkliftForkHeight(vehicle:Dynamic, height:Float):Dynamic
0.0 = Lowest 1.0 = Highest. This is best to be used if you wanna pick-up a car since un-realistically on GTA V forklifts can't pick up much of anything due to vehicle mass. If you put this under a car then set it above 0.0 to a 'lifted-value' it will raise the car with no issue lolstaticsetGarbageTrucks(toggle:Bool):Dynamic
staticsetHeliBladesFullSpeed(vehicle:Dynamic):Dynamic
Equivalent of SET_HELI_BLADES_SPEED(vehicleHandle, 1.0f);
this native works on planes to? staticsetHeliBladesSpeed(vehicle:Dynamic, speed:Float):Dynamic
Sets the speed of the helicopter blades in percentage of the full speed.
vehicleHandle: The helicopter.
speed: The speed in percentage, 0.0f being 0% and 1.0f being 100%. staticsetHeliCombatOffset(vehicle:Dynamic, x:Float, y:Float, z:Float):Dynamic
Set a specific offset for helis chasing target in combat
NativeDB Introduced: v1180staticsetHeliResistToExplosion(helicopter:Dynamic, bResistToExplosion:Bool):Dynamic
Makes a helicopter resistant to multiple explosions. When enabled, helicopters can survive two or more explosions.
NativeDB Introduced: 2545staticsetHeliTailBoomCanBreakOff(heli:Dynamic, toggle:Bool):Dynamic
Enables or disables the ability for a helicopter's tail boom to break off.
NativeDB Introduced: v323staticsetHeliTurbulenceScalar(vehicle:Dynamic, p1:Float):Dynamic
staticsetHoverModeWingRatio(vehicle:Dynamic, ratio:Float):Dynamic
This native allows opening or closing the wings of the Deluxo/Oppressor. For the Deluxo, wing deployment depends on sufficient altitude.
staticsetLastDrivenVehicle(vehicle:Dynamic):Dynamic
staticsetLightsCutoffDistanceTweak(distance:Float):Dynamic
staticsetMissionTrainCoords(train:Dynamic, x:Float, y:Float, z:Float):Dynamic
staticsetNitrousIsActive(vehicle:Dynamic, isActive:Bool):Dynamic
NativeDB Introduced: 3095
Activates or deactivates the nitrous system in the specified vehicle, based on the boolean value provided.
You can clear the nitrous with CLEAR_NITROUS, if you want to have more control on the nitrous and those settings, use SET_OVERRIDE_NITROUS_LEVEL
staticsetNumberOfParkedVehicles(value:Int):Dynamic
staticsetOpenRearDoorsOnExplosion(vehicle:Dynamic, toggle:Bool):Dynamic
Enables or disables the opening of a vehicle's rear doors in the event of a sticky bomb explosion. This native is effective for armored vehicles, such as the Stockade (Brinks vehicle), allowing the rear doors to be opened through controlled explosions, which might otherwise remain locked due to the vehicle nature.
staticsetOverrideNitrousLevel(vehicle:Dynamic, override_:Bool):Dynamic
NativeDB Introduced: v1604
NativeDB Added Parameter 2 (2060): float durationMod : A multiplier applied to the default nitrous duration (default is 3 seconds).
NativeDB Added Parameter 3 (2060): float power : A multiplier applied to the default nitrous power multiplier (default is 3).
NativeDB Added Parameter 4 (2060): float rechargeTime : A multiplier applied to the default nitrous recharge rate.
NativeDB Added Parameter 5 (2060): BOOL disableSound : A boolean to disable the default nitrous sound when the nitrous is active.
Overrides the default settings of a vehicle's nitrous system, allowing custom control over its performance characteristics.
staticsetParkedVehicleDensityMultiplierThisFrame(multiplier:Float):Dynamic
staticsetPickupRopeLengthForCargobob(cargobob:Dynamic, length1:Float, length2:Float, state:Bool):Dynamic
min: 1.9f, max: 100.0fstaticsetPlaneResistToExplosion(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetPlaneSectionDamageScale(vehicle:Dynamic, damageSection:Int, damageScale:Float):Dynamic
Adjusts the scale of damage applied to a specified section of a plane.
In the decompiled scripts the damageScale is always set to 0f (maybe to disable damages on the specified section)
enum ePlaneDamageSection {
WING_L = 0,
WING_R = 1,
TAIL = 2,
ENGINE_L = 3,
ENGINE_R = 4,
ELEVATOR_L = 5,
ELEVATOR_R = 6,
AILERON_L = 7,
AILERON_R = 8,
RUDDER = 9,
RUDDER_2 = 10,
AIRBRAKE_L = 11,
AIRBRAKE_R = 12
}
NativeDB Introduced: v1290staticsetPlaneTurbulenceMultiplier(vehicle:Dynamic, multiplier:Float):Dynamic
This native sets the turbulence multiplier. It only works for planes. 0.0 = no turbulence at all. 1.0 = heavy turbulence.
Works by just calling it once, does not need to be called every tick.
staticsetPlaybackSpeed(vehicle:Dynamic, speed:Float):Dynamic
staticsetPlaybackToUseAi(vehicle:Dynamic, drivingStyle:Int):Dynamic
Identical to SET_PLAYBACK_TO_USE_AI_TRY_TO_REVERT_BACK_LATER with 0 as arguments for p1 and p3.
staticsetPlaybackToUseAiTryToRevertBackLater(vehicle:Dynamic, time:Int, drivingStyle:Int, p3:Bool):Dynamic
Time is number of milliseconds before reverting, zero for indefinitely.staticsetPlayersLastVehicle(vehicle:Dynamic):Dynamic
staticsetPoliceFocusWillTrackVehicle(vehicle:Dynamic, p1:Bool):Dynamic
Sets flag on vehicle that changes behaviour in relation to when player gets wanted level
staticsetRandomBoats(toggle:Bool):Dynamic
staticsetRandomTrains(toggle:Bool):Dynamic
Enables spawning random trains on the preset tracks.
Requires SWITCH_TRAIN_TRACK and SET_TRAIN_TRACK_SPAWN_FREQUENCY to be set.
staticsetRandomVehicleDensityMultiplierThisFrame(multiplier:Float):Dynamic
staticsetRenderTrainAsDerailed(train:Dynamic, toggle:Bool):Dynamic
makes the train all jumbled up and derailed as it moves on the tracks (though that wont stop it from its normal operations) staticsetScriptVehicleGenerator(vehicleGenerator:Int, enabled:Bool):Dynamic
Only called once in the decompiled scripts. Presumably activates the specified generator. staticsetSpecialFlightModeAllowed(vehicle:Dynamic, toggle:Bool):Dynamic
Allows locking the hover/non-hover mode of a vehicle, such as the flying mode of the Deluxo. In the decompiled scripts, this native is used on oppressor2 but couldn't get it to work on it.
staticsetSpecialFlightModeRatio(vehicle:Dynamic, ratio:Float):Dynamic
Used alongside SET_SPECIAL_FLIGHT_MODE_TARGET_RATIO, this function initiates hover transformation for vehicles with a hover mode, like the Deluxo, based on a specified ratio (0.0 to 1.0). Incorrect values can glitch the vehicle. Without pairing, vehicles revert to car mode. Ineffective on the oppressor2
staticsetSpecialFlightModeTargetRatio(vehicle:Dynamic, state:Float):Dynamic
According to decompiled scripts this should work with the deluxo and oppressor2 vehicles.
Does nothing when used on oppressor2.
For the deluxo:
- Set
stateto0.0: Fully transform to a 'road' vehicle (non-hover mode). - Set
stateto1.0: Fully transform to a 'flying' vehicle (hover mode).
If you set it to something like 0.5, then something weird happens, you end up in some 50% hover mode, 50% not hover mode.
This doesn't need to be called every tick, just once and the vehicle will transform to that state at the usual transform speed. It'll just stop transforming when it reaches the state you provided.
Once this native is used then players will just be able to hit the vehicle transform key to toggle the transformation cycle; it won't block users from using the key.
staticsetSubmarineCrushDepths(vehicle:Dynamic, toggle:Bool, depth1:Float, depth2:Float, depth3:Float):Dynamic
staticsetTaskVehicleGotoPlaneMinHeightAboveTerrain(plane:Dynamic, height:Int):Dynamic
staticsetTaxiLights(vehicle:Dynamic, state:Bool):Dynamic
This is not tested - it's just an assumption.
Doesn't seem to work. I'll try with an int instead. --JT
Read the scripts, im dumpass.
Doesn't work at all, wether with an bool neither an int
if (!VEHICLE::IS_TAXI_LIGHT_ON(l_115)) {
VEHICLE::SET_TAXI_LIGHTS(l_115, 1);
} staticsetTrailerInverseMassScale(vehicle:Dynamic, p1:Float):Dynamic
staticsetTrailerLegsRaised(vehicle:Dynamic):Dynamic
in the decompiled scripts, seems to be always called on the vehicle right after being attached to a trailer.staticsetTrainCruiseSpeed(train:Dynamic, speed:Float):Dynamic
Used to control train speed, can be used to start and stop its movement as well.
staticsetTrainSpeed(train:Dynamic, speed:Float):Dynamic
staticsetTrainTrackSpawnFrequency(trackIndex:Int, frequency:Int):Dynamic
Only called once inside main_persitant with the parameters, 0 staticsetTransformRateForAnimation(vehicle:Dynamic, transformRate:Float):Dynamic
Affects the playback speed of the submarine car conversion animations. Does not affect hardcoded animations such as the wheels being retracted. In decompiled scripts the only value used for transformRate is 2.5.
staticsetTransformToSubmarineUsesAlternateInput(vehicle:Dynamic, useAlternateInput:Dynamic):Dynamic
Changes the key used to transform a vehicle into submarine mode. When set to true, the transformation key switches from the default raise/lower convertible roof key (usually 'H') to the special vehicle transformation key (usually 'X').
NativeDB Introduced: v1365staticsetVehicleActAsIfHighSpeedForFragSmashing(vehicle:Dynamic, actHighSpeed:Bool):Dynamic
This native is used to simulate a high-speed impact for a vehicle when it collides with a breakable object (frag). It's particularly useful in scripted sequences where a vehicle is required to break through a barrier but might not actually be moving at a sufficient speed to do so realistically. Note that this setting is temporary and will reset after one frame, so it needs to be called every frame for a lasting effect.
staticsetVehicleActiveDuringPlayback(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleActiveForPedNavigation(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleAlarm(vehicle:Dynamic, state:Bool):Dynamic
staticsetVehicleAllowNoPassengersLockon(veh:Dynamic, toggle:Bool):Dynamic
Makes the vehicle accept no passengers. staticsetVehicleAutomaticallyAttaches(vehicle:Dynamic, p1:Bool, p2:Dynamic):Dynamic
staticsetVehicleBodyHealth(vehicle:Dynamic, value:Float):Dynamic
p2 often set to 1000.0 in the decompiled scripts. staticsetVehicleBrake(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleBrakeLights(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleBulldozerArmPosition(vehicle:Dynamic, position:Float, p2:Bool):Dynamic
Sets the arm position of a bulldozer. Position must be a value between 0.0 and 1.0. Ignored when p2 is set to false, instead incrementing arm position by 0.1 (or 10%).
staticsetVehicleBurnout(vehicle:Dynamic, toggle:Bool):Dynamic
On accelerating, spins the driven wheels with the others braked, so you don't go anywhere. staticsetVehicleCanBeTargetted(vehicle:Dynamic, state:Bool):Dynamic
This has not yet been tested - it's just an assumption of what the types could be. staticsetVehicleCanBeUsedByFleeingPeds(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleCanBeVisiblyDamaged(vehicle:Dynamic, state:Bool):Dynamic
staticsetVehicleCanBreak(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleCanDeformWheels(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleCanLeakOil(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleCanLeakPetrol(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleCanSaveInGarage(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleCeilingHeight(vehicle:Dynamic, height:Float):Dynamic
Previously named GET_VEHICLE_DEFORMATION_GET_TREE (hash collision)
from Decrypted Scripts I found
VEHICLE::SET_VEHICLE_CEILING_HEIGHT(l_BD9[2/ *2* /], 420.0);staticsetVehicleCheatPowerIncrease(vehicle:Dynamic, value:Float):Dynamic
<1.0 - Decreased torque
=1.0 - Default torque
>1.0 - Increased torque
Negative values will cause the vehicle to go backwards instead of forwards while accelerating.
value - is between 0.2 and 1.8 in the decompiled scripts.
This needs to be called every frame to take effect.staticsetVehicleColourCombination(vehicle:Dynamic, colorCombination:Int):Dynamic
Sets the selected vehicle's colors to their default value (specific variant specified using the colorCombination parameter).
Range of possible values for colorCombination is currently unknown, I couldn't find where these values are stored either (Disquse's guess was vehicles.meta but I haven't seen it in there.)
staticsetVehicleColours(vehicle:Dynamic, colorPrimary:Int, colorSecondary:Int):Dynamic
colorPrimary & colorSecondary are the paint indexes for the vehicle.
For a list of valid paint indexes, view: pastebin.com/pwHci0xK
staticsetVehicleCustomPrimaryColour(vehicle:Dynamic, r:Int, g:Int, b:Int):Dynamic
p1, p2, p3 are RGB values for color (255,0,0 for Red, ect) staticsetVehicleCustomSecondaryColour(vehicle:Dynamic, r:Int, g:Int, b:Int):Dynamic
p1, p2, p3 are RGB values for color (255,0,0 for Red, ect) staticsetVehicleDamage(vehicle:Dynamic, xOffset:Float, yOffset:Float, zOffset:Float, damage:Float, radius:Float, focusOnModel:Bool):Dynamic
Apply damage to vehicle at a location. Location is relative to vehicle model (not world).
Radius of effect damage applied in a sphere at impact location
When focusOnModel set to true, the damage sphere will travel towards the vehicle from the given point, thus guaranteeing an impact
staticsetVehicleDeformationFixed(vehicle:Dynamic):Dynamic
This fixes the deformation of a vehicle but the vehicle health doesn't improve staticsetVehicleDensityMultiplierThisFrame(multiplier:Float):Dynamic
Usage:
- Use this native inside a looped function.
- Values:
0.0= no vehicles on streets1.0= normal vehicles on streets
1.0 Seems to be the maximum.
staticsetVehicleDirtLevel(vehicle:Dynamic, dirtLevel:Float):Dynamic
Sets the dirt level of the passed vehicle.
staticsetVehicleDisableTowing(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleDoorBroken(vehicle:Dynamic, doorIndex:Int, deleteDoor:Bool):Dynamic
See eDoorId declared in SET_VEHICLE_DOOR_SHUT
staticsetVehicleDoorControl(vehicle:Dynamic, doorIndex:Int, speed:Int, angle:Float):Dynamic
See eDoorId declared in SET_VEHICLE_DOOR_SHUT
staticsetVehicleDoorLatched(vehicle:Dynamic, doorIndex:Int, forceClose:Bool, lock:Bool, p4:Bool):Dynamic
See eDoorId declared in SET_VEHICLE_DOOR_SHUT
staticsetVehicleDoorOpen(vehicle:Dynamic, doorIndex:Int, loose:Bool, openInstantly:Bool):Dynamic
Sets the specified door index open on the passed vehicle. See IS_VEHICLE_DOOR_FULLY_OPEN.
staticsetVehicleDoorShut(vehicle:Dynamic, doorIndex:Int, closeInstantly:Bool):Dynamic
Sets the specified door index shut on the passed vehicle.
enum eDoorId
{
VEH_EXT_DOOR_DSIDE_F = 0,
VEH_EXT_DOOR_DSIDE_R = 1,
VEH_EXT_DOOR_PSIDE_F = 2,
VEH_EXT_DOOR_PSIDE_R = 3,
VEH_EXT_BONNET = 4,
VEH_EXT_BOOT = 5,
// 0x872E72B8 = 0xFFFFFFFF,
}staticsetVehicleDoorsLocked(vehicle:Dynamic, doorLockStatus:Int):Dynamic
Locks the doors of a specified vehicle to a defined lock state, affecting how players and NPCs can interact with the vehicle.
NativeDB Introduced: v323
enum eVehicleLockState {
// No specific lock state, vehicle behaves according to the game's default settings.
VEHICLELOCK_NONE = 0,
// Vehicle is fully unlocked, allowing free entry by players and NPCs.
VEHICLELOCK_UNLOCKED = 1,
// Vehicle is locked, preventing entry by players and NPCs.
VEHICLELOCK_LOCKED = 2,
// Vehicle locks out only players, allowing NPCs to enter.
VEHICLELOCK_LOCKOUT_PLAYER_ONLY = 3,
// Vehicle is locked once a player enters, preventing others from entering.
VEHICLELOCK_LOCKED_PLAYER_INSIDE = 4,
// Vehicle starts in a locked state, but may be unlocked through game events.
VEHICLELOCK_LOCKED_INITIALLY = 5,
// Forces the vehicle's doors to shut and lock.
VEHICLELOCK_FORCE_SHUT_DOORS = 6,
// Vehicle is locked but can still be damaged.
VEHICLELOCK_LOCKED_BUT_CAN_BE_DAMAGED = 7,
// Vehicle is locked, but its trunk/boot remains unlocked.
VEHICLELOCK_LOCKED_BUT_BOOT_UNLOCKED = 8,
// Vehicle is locked and does not allow passengers, except for the driver.
VEHICLELOCK_LOCKED_NO_PASSENGERS = 9,
// Vehicle is completely locked, preventing entry entirely, even if previously inside.
VEHICLELOCK_CANNOT_ENTER = 10
};
staticsetVehicleDoorsLockedForAllPlayers(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleDoorsLockedForNonScriptPlayers(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleDoorsLockedForPlayer(vehicle:Dynamic, player:Dynamic, toggle:Bool):Dynamic
staticsetVehicleDoorsLockedForTeam(vehicle:Dynamic, team:Int, toggle:Bool):Dynamic
staticsetVehicleDoorsShut(vehicle:Dynamic, closeInstantly:Bool):Dynamic
Closes all doors of a vehicle: staticsetVehicleDropsMoneyWhenBlownUp(vehicle:Dynamic, toggle:Bool):Dynamic
Money pickups are created around cars when they explode. Only works when the vehicle model is a car. A single pickup is between 1 and 18 dollars in size. All car models seem to give the same amount of money.
youtu.be/3arlUxzHl5Y
i.imgur.com/WrNpYFs.jpgstaticsetVehicleEngineCanDegrade(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleEngineHealth(vehicle:Dynamic, health:Float):Dynamic
1000 is max health
Begins leaking gas at around 650 health
-999.90002441406 appears to be minimum health, although nothing special occurs <- false statement
-------------------------
Minimum: -4000
Maximum: 1000
-4000: Engine is destroyed
0 and below: Engine catches fire and health rapidly declines
300: Engine is smoking and losing functionality
1000: Engine is perfectstaticsetVehicleEngineOn(vehicle:Dynamic, value:Bool, instantly:Bool, disableAutoStart:Bool):Dynamic
Starts or stops the engine on the specified vehicle. From what I've tested when I do this to a helicopter the propellers turn off after the engine has started.
staticsetVehicleEnveffScale(vehicle:Dynamic, fade:Float):Dynamic
Examples with a besra:
The parameter fade is a value from 0-1, where 0 is fresh paint.
staticsetVehicleExclusiveDriver(vehicle:Dynamic, toggle:Bool):Dynamic
Incorrectly named SET_VEHICLE_EXCLUSIVE_DRIVER; likely SET_VEHICLE_ALLOW_*.
Toggles a flag related to SET_VEHICLE_EXCLUSIVE_DRIVER, however, doesn't enable that feature (or trigger script events related to it).
See _SET_VEHICLE_EXCLUSIVE_DRIVER_2.
NativeDB Removed Parameter 2: int indexstaticsetVehicleExplodesOnHighExplosionDamage(vehicle:Dynamic, toggle:Bool):Dynamic
Sets a vehicle to be strongly resistant to explosions. p0 is the vehicle; set p1 to false to toggle the effect on/off. staticsetVehicleExtra(vehicle:Dynamic, extraId:Int, disable:Bool):Dynamic
Note: only some vehicle have extras
extra ids are from 1 - 9 depending on the vehicle
-------------------------------------------------
^ not sure if outdated or simply wrong. Max extra ID for b944 is 14
-------------------------------------------------
p2 is not a on/off toggle. mostly 0 means on and 1 means off.
not sure if it really should be a BOOL.
-------------------------------------------------
Confirmed p2 does not work as a bool. Changed to int. [0=on, 1=off] staticsetVehicleExtraColours(vehicle:Dynamic, pearlescentColor:Int, wheelColor:Int):Dynamic
They use the same color indexs as SET_VEHICLE_COLOURS. staticsetVehicleFixed(vehicle:Dynamic):Dynamic
Fix a given vehicle. If the vehicle's engine's broken then you cannot fix it with this native.
staticsetVehicleFlightNozzlePosition(vehicle:Dynamic, angleRatio:Float):Dynamic
staticsetVehicleFlightNozzlePositionImmediate(vehicle:Dynamic, angle:Float):Dynamic
staticsetVehicleForceAfterburner(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleForwardSpeed(vehicle:Dynamic, speed:Float):Dynamic
SCALE: Setting the speed to 30 would result in a speed of roughly 60mph, according to speedometer.
Speed is in meters per second
You can convert meters/s to mph here:
http://www.calculateme.com/Speed/MetersperSecond/ToMilesperHour.htm staticsetVehicleFrictionOverride(vehicle:Dynamic, friction:Float):Dynamic
Seems to be related to the metal parts, not tyres (like i was expecting lol)
Must be called every tick. staticsetVehicleFullbeam(vehicle:Dynamic, toggle:Bool):Dynamic
It switch to highbeam when p1 is set to true. staticsetVehicleGeneratesEngineShockingEvents(vehicle:Dynamic, toggle:Bool):Dynamic
Allows creation of CEventShockingPlaneFlyby, CEventShockingHelicopterOverhead, and other(?) Shocking eventsstaticsetVehicleGeneratorAreaOfInterest(x:Float, y:Float, z:Float, radius:Float):Dynamic
Specifies an area of interest where cargens will focus on spawning vehicles
You can clear the area of interest with CLEAR_VEHICLE_GENERATOR_AREA_OF_INTEREST
staticsetVehicleGravity(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleHandbrake(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleHasBeenDrivenFlag(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleHasBeenOwnedByPlayer(vehicle:Dynamic, owned:Bool):Dynamic
staticsetVehicleHasMutedSirens(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleHasUnbreakableLights(vehicle:Dynamic, toggle:Bool):Dynamic
Sets whether the vehicle's lights can be broken.
NativeDB Introduced: v323staticsetVehicleHeadlightShadows(vehicle:Dynamic, flag:Int):Dynamic
Sets the vehicle headlight shadow flags.
NativeDB Introduced: v323
enum eVehicleHeadlightShadowFlags {
// Default (Lights can be toggled between off, normal and high beams)
NO_HEADLIGHT_SHADOWS = 0,
// Lights Disabled (Lights are fully disabled, cannot be toggled)
HEADLIGHTS_CAST_DYNAMIC_SHADOWS = 1,
// Always On (Lights can be toggled between normal and high beams)
HEADLIGHTS_CAST_STATIC_SHADOWS = 2,
HEADLIGHTS_CAST_FULL_SHADOWS = 3
};staticsetVehicleInactiveDuringPlayback(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleIndicatorLights(vehicle:Dynamic, turnSignal:Int, toggle:Bool):Dynamic
Sets the turn signal enabled for a vehicle.
Set turnSignal to 1 for left light, 0 for right light. staticsetVehicleIndividualDoorsLocked(vehicle:Dynamic, doorIndex:Int, doorLockStatus:Int):Dynamic
staticsetVehicleInfluencesWantedLevel(vehicle:Dynamic, influenceWantedLevel:Bool):Dynamic
This native sets whether a specific vehicle influences the player's wanted level when it is involved in an incident that typically triggers a wanted response, such as being marked as a "victim" vehicle.
This is particularly useful when utilizing the wanted system from GTA, and you want to prevent a vehicle from affecting the wanted level when it is stolen. In the decompiled scripts this native is only used to disable the influence of the vehicle on the wanted level.
staticsetVehicleInteriorlight(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleIsConsideredByPlayer(vehicle:Dynamic, toggle:Bool):Dynamic
Setting this to false, makes the specified vehicle to where if you press Y your character doesn't even attempt the animation to enter the vehicle. Hence it's not considered aka ignored. staticsetVehicleIsRacing(vehicle:Dynamic, toggle:Bool):Dynamic
p1 (toggle) was always 1 (true) except in one case in the b678 scripts. staticsetVehicleIsStolen(vehicle:Dynamic, isStolen:Bool):Dynamic
staticsetVehicleKeepEngineOnWhenAbandoned(vehicle:Dynamic, toggle:Bool):Dynamic
Calling this native will keep a vehicle's engine running after exiting.
staticsetVehicleKersAllowed(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleLightMultiplier(vehicle:Dynamic, multiplier:Float):Dynamic
This multiplier has no limit, by default the game has this set to 1.0.
staticsetVehicleLights(vehicle:Dynamic, state:Int):Dynamic
Sets the vehicle lights state. Allowing for different lighting modes.
NativeDB Introduced: v323
enum eVehicleLightSetting {
// Normal light behavior. Lights cycle through off, then low beams, then high beams.
// Note: It's affected by day or night; high beams don't exist in daytime.
NO_VEHICLE_LIGHT_OVERRIDE = 0,
// Vehicle doesn't have lights, always off.
FORCE_VEHICLE_LIGHTS_OFF = 1,
// Vehicle has always-on lights.
// During day: Cycles between low beams and high beams.
// At night: Cycles between low beams, low beams, and high beams.
FORCE_VEHICLE_LIGHTS_ON = 2,
// Sets vehicle lights on. Behaves like normal lights (same as 0).
SET_VEHICLE_LIGHTS_ON = 3,
// Sets vehicle lights off. Behaves like normal lights (same as 0).
SET_VEHICLE_LIGHTS_OFF = 4
};staticsetVehicleLivery(vehicle:Dynamic, livery:Int):Dynamic
staticsetVehicleLodMultiplier(vehicle:Dynamic, multiplier:Float):Dynamic
staticsetVehicleMod(vehicle:Dynamic, modType:Int, modIndex:Int, customTires:Bool):Dynamic
// eVehicleModType values modified to conform to script native reorganization (see 0x140D25327 in 1604).
enum eVehicleModType
{
VMT_SPOILER = 0,
VMT_BUMPER_F = 1,
VMT_BUMPER_R = 2,
VMT_SKIRT = 3,
VMT_EXHAUST = 4,
VMT_CHASSIS = 5,
VMT_GRILL = 6,
VMT_BONNET = 7,
VMT_WING_L = 8,
VMT_WING_R = 9,
VMT_ROOF = 10,
VMT_ENGINE = 11,
VMT_BRAKES = 12,
VMT_GEARBOX = 13,
VMT_HORN = 14,
VMT_SUSPENSION = 15,
VMT_ARMOUR = 16,
VMT_NITROUS = 17,
VMT_TURBO = 18,
VMT_SUBWOOFER = 19,
VMT_TYRE_SMOKE = 20,
VMT_HYDRAULICS = 21,
VMT_XENON_LIGHTS = 22,
VMT_WHEELS = 23,
VMT_WHEELS_REAR_OR_HYDRAULICS = 24,
VMT_PLTHOLDER = 25,
VMT_PLTVANITY = 26,
VMT_INTERIOR1 = 27,
VMT_INTERIOR2 = 28,
VMT_INTERIOR3 = 29,
VMT_INTERIOR4 = 30,
VMT_INTERIOR5 = 31,
VMT_SEATS = 32,
VMT_STEERING = 33,
VMT_KNOB = 34,
VMT_PLAQUE = 35,
VMT_ICE = 36,
VMT_TRUNK = 37,
VMT_HYDRO = 38,
VMT_ENGINEBAY1 = 39,
VMT_ENGINEBAY2 = 40,
VMT_ENGINEBAY3 = 41,
VMT_CHASSIS2 = 42,
VMT_CHASSIS3 = 43,
VMT_CHASSIS4 = 44,
VMT_CHASSIS5 = 45,
VMT_DOOR_L = 46,
VMT_DOOR_R = 47,
VMT_LIVERY_MOD = 48,
VMT_LIGHTBAR = 49,
};staticsetVehicleModColor1(vehicle:Dynamic, paintType:Int, color:Int, pearlescentColor:Int):Dynamic
paintType:
0: Normal
1: Metallic
2: Pearl
3: Matte
4: Metal
5: Chrome
color: number of the color.
p3 seems to always be 0. staticsetVehicleModColor2(vehicle:Dynamic, paintType:Int, color:Int):Dynamic
Changes the secondary paint type and color
paintType:
0: Normal
1: Metallic
2: Pearl
3: Matte
4: Metal
5: Chrome
color: number of the color staticsetVehicleModKit(vehicle:Dynamic, modKit:Int):Dynamic
Set modKit to 0 if you plan to call SET_VEHICLE_MOD. That's what the game does. Most body modifications through SET_VEHICLE_MOD will not take effect until this is set to 0.staticsetVehicleModelIsSuppressed(model:Int, suppressed:Bool):Dynamic
seems to make the vehicle stop spawning naturally in traffic. Here's an essential example:
VEHICLE::SET_VEHICLE_MODEL_IS_SUPPRESSED(GAMEPLAY::GET_HASH_KEY("taco"), true); staticsetVehicleNameDebug(vehicle:Dynamic, name:String):Dynamic
This method is utilized solely for debugging purposes and is functional only in debug builds of the game. Please note that its functionality may not be available in the retail version.
staticsetVehicleNeedsToBeHotwired(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleNumberPlateText(vehicle:Dynamic, plateText:String):Dynamic
staticsetVehicleNumberPlateTextIndex(vehicle:Dynamic, plateIndex:Int):Dynamic
Please refer to GET_VEHICLE_NUMBER_PLATE_TEXT_INDEX for plate indicies.
staticsetVehicleOnGroundProperly(vehicle:Dynamic):Bool
Sets a vehicle on the ground on all wheels. Returns whether or not the operation was successful.
NativeDB Added Parameter 2: float p1staticsetVehicleOutOfControl(vehicle:Dynamic, killDriver:Bool, explodeOnImpact:Bool):Dynamic
Tested on the player's current vehicle. Unless you kill the driver, the vehicle doesn't loose control, however, if enabled, explodeOnImpact is still active. The moment you crash, boom. staticsetVehiclePetrolTankHealth(vehicle:Dynamic, health:Float):Dynamic
1000 is max health
Begins leaking gas at around 650 health staticsetVehicleProvidesCover(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleReduceGrip(vehicle:Dynamic, toggle:Bool):Dynamic
Reduces grip significantly so it's hard to go anywhere. staticsetVehicleRudderBroken(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleSearchlight(heli:Dynamic, toggle:Bool, canBeUsedByAI:Bool):Dynamic
Only works during nighttime.staticsetVehicleShootAtTarget(driver:Dynamic, entity:Dynamic, xTarget:Float, yTarget:Float, zTarget:Float):Dynamic
Commands the driver of an armed vehicle (p0) to shoot its weapon at a target (p1). p3, p4 and p5 are the coordinates of the target. Example:
WEAPON::SET_CURRENT_PED_VEHICLE_WEAPON(pilot,GAMEPLAY::GET_HASH_KEY("VEHICLE_WEAPON_PLANE_ROCKET"));VEHICLE::SET_VEHICLE_SHOOT_AT_TARGET(pilot, target, targPos.x, targPos.y, targPos.z); staticsetVehicleSiren(vehicle:Dynamic, toggle:Bool):Dynamic
Activate siren on vehicle (Only works if the vehicle has a siren). staticsetVehicleSteerBias(vehicle:Dynamic, value:Float):Dynamic
Locks the vehicle's steering to the desired angle, explained below.
Requires to be called onTick. Steering is unlocked the moment the function stops being called on the vehicle.
Steer bias:
-1.0 = full right
0.0 = centered steering
1.0 = full left staticsetVehicleSteeringBiasScalar(vehicle:Dynamic, scalar:Float):Dynamic
staticsetVehicleStrong(vehicle:Dynamic, toggle:Bool):Dynamic
If set to true, vehicle will not take crash damage, but is still susceptible to damage from bullets and explosives staticsetVehicleTankTurretPosition(vehicle:Dynamic, position:Float, p2:Bool):Dynamic
staticsetVehicleTimedExplosion(vehicle:Dynamic, ped:Dynamic, toggle:Bool):Dynamic
staticsetVehicleTowTruckArmPosition(vehicle:Dynamic, position:Float):Dynamic
Sets how much the crane on the tow truck is raised, where 0.0 is fully lowered and 1.0 is fully raised. staticsetVehicleTurretSpeedThisFrame(vehicle:Dynamic, speed:Float):Dynamic
staticsetVehicleTyreBurst(vehicle:Dynamic, index:Int, onRim:Bool, p3:Float):Dynamic
"To burst tyres VEHICLE::SET_VEHICLE_TYRE_BURST(vehicle, 0, true, 1000.0)
to burst all tyres type it 8 times where p1 = 0 to 7.
p3 seems to be how much damage it has taken. 0 doesn't deflate them, 1000 completely deflates them.
'0 = wheel_lf / bike, plane or jet front
'1 = wheel_rf
'2 = wheel_lm / in 6 wheels trailer, plane or jet is first one on left
'3 = wheel_rm / in 6 wheels trailer, plane or jet is first one on right
'4 = wheel_lr / bike rear / in 6 wheels trailer, plane or jet is last one on left
'5 = wheel_rr / in 6 wheels trailer, plane or jet is last one on right
'45 = 6 wheels trailer mid wheel left
'47 = 6 wheels trailer mid wheel right staticsetVehicleTyreFixed(vehicle:Dynamic, tyreIndex:Int):Dynamic
tyreIndex = 0 to 4 on normal vehicles
'0 = wheel_lf / bike, plane or jet front
'1 = wheel_rf
'2 = wheel_lm / in 6 wheels trailer, plane or jet is first one on left
'3 = wheel_rm / in 6 wheels trailer, plane or jet is first one on right
'4 = wheel_lr / bike rear / in 6 wheels trailer, plane or jet is last one on left
'5 = wheel_rr / in 6 wheels trailer, plane or jet is last one on right
'45 = 6 wheels trailer mid wheel left
'47 = 6 wheels trailer mid wheel right staticsetVehicleTyreSmokeColor(vehicle:Dynamic, r:Int, g:Int, b:Int):Dynamic
Sets the tire smoke's color of this vehicle.
vehicle: The vehicle that is the target of this method.
r: The red level in the RGB color code.
g: The green level in the RGB color code.
b: The blue level in the RGB color code.
Note:
setting r,g,b to 0 will give the car independance day tyre smoke staticsetVehicleTyresCanBurst(vehicle:Dynamic, toggle:Bool):Dynamic
Allows you to toggle bulletproof tires. staticsetVehicleUndriveable(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleUseAlternateHandling(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleUseCutsceneWheelCompression(p0:Dynamic, p1:Bool, p2:Bool, p3:Bool):Dynamic
staticsetVehicleUsePlayerLightSettings(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleWheelType(vehicle:Dynamic, wheelType:Int):Dynamic
Refer to GET_VEHICLE_WHEEL_TYPE for wheel types.
staticsetVehicleWheelsCanBreak(vehicle:Dynamic, enabled:Bool):Dynamic
staticsetVehicleWheelsCanBreakOffWhenBlowUp(vehicle:Dynamic, toggle:Bool):Dynamic
staticsetVehicleWindowTint(vehicle:Dynamic, tint:Int):Dynamic
enum WindowTints
{
WINDOWTINT_NONE = 0,
WINDOWTINT_PURE_BLACK = 1,
WINDOWTINT_DARKSMOKE = 2,
WINDOWTINT_LIGHTSMOKE = 3,
WINDOWTINT_STOCK = 4,
WINDOWTINT_LIMO = 5,
WINDOWTINT_GREEN = 6
}; staticskipTimeInPlaybackRecordedVehicle(vehicle:Dynamic, time:Float):Dynamic
SET_TIME_POSITION_IN_RECORDING can be emulated by: desired_time - GET_TIME_POSITION_IN_RECORDING(vehicle)staticskipToEndAndStopPlaybackRecordedVehicle(vehicle:Dynamic):Dynamic
staticsmashVehicleWindow(vehicle:Dynamic, windowIndex:Int):Dynamic
Smashes a vehicles window. See eWindowId declared in IS_VEHICLE_WINDOW_INTACT.
staticstabiliseEntityAttachedToHeli(vehicle:Dynamic, entity:Dynamic, p2:Float):Dynamic
staticstartPlaybackRecordedVehicle(vehicle:Dynamic, recording:Int, script:String, p3:Bool):Dynamic
p3 is some flag related to 'trailers' (invokes CVehicle::GetTrailer).
staticstartPlaybackRecordedVehicleUsingAi(vehicle:Dynamic, recording:Int, script:String, speed:Float, drivingStyle:Int):Dynamic
AI abides by the provided driving style (e.g., stopping at red lights or waiting behind traffic) while executing the specificed vehicle recording.
0x1F2E4E06DEA8992B is a related native that deals with the AI physics for such recordings.staticstartPlaybackRecordedVehicleWithFlags(vehicle:Dynamic, recording:Int, script:String, flags:Int, time:Int, drivingStyle:Int):Dynamic
flags requires further research, e.g., 0x4/0x8 are related to the AI driving task and 0x20 is internally set and interacts with dynamic entity components.
time, often zero and capped at 500, is related to SET_PLAYBACK_TO_USE_AI_TRY_TO_REVERT_BACK_LATERstaticstartVehicleAlarm(vehicle:Dynamic):Dynamic
staticstartVehicleHorn(vehicle:Dynamic, duration:Int, mode:Int, forever:Bool):Dynamic
Sounds the horn for the specified vehicle. Note that if a player is in the vehicle, it will only sound briefly.
staticstopAllGarageActivity():Dynamic
staticstopPlaybackRecordedVehicle(vehicle:Dynamic):Dynamic
staticswitchTrainTrack(trackId:Int, state:Bool):Dynamic
Toggles whether ambient trains can spawn on the specified track or not.
| trackId | File | Description |
|---|---|---|
| 0 | trains1.dat | Main track around SA |
| 1 | trains2.dat | Davis Quartz Quarry branch |
| 2 | trains3.dat | Second track alongside live track along Roy Lewenstein Blv. |
| 3 | trains4.dat | Metro track circuit |
| 4 | trains5.dat | Branch in Mirror Park Railyard |
| 5 | trains6.dat | Branch in Mirror Park Railyard |
| 6 | trains7.dat | LS branch to Mirror Park Railyard |
| 7 | trains8.dat | Overground part of metro track along Forum Dr. |
| 8 | trains9.dat | Branch to Mirror Park Railyard |
| 9 | trains10.dat | Yankton train |
| 10 | trains11.dat | Part of metro track near mission row |
| 11 | trains12.dat | Yankton prologue mission train |
Tracks IDs 0 and 3 are the main tracks you find trains on during normal gameplay, all the others are used during missions and are not complete tracks.
statictoggleVehicleMod(vehicle:Dynamic, modType:Int, toggle:Bool):Dynamic
Enables or disables a vehicle mod by index (modType) for a given vehicle.
eVehicleModType enum, used for modType index can be found under SET_VEHICLE_MOD.
statictrackVehicleVisibility(vehicle:Dynamic):Dynamic
in script hook .net
Vehicle v = ...;
Function.Call(Hash.TRACK_VEHICLE_VISIBILITY, v.Handle); statictransformToCar(vehicle:Dynamic, instantly:Bool):Dynamic
Transforms the stormberg to its "road vehicle" variant. If the vehicle is already in that state then the vehicle transformation audio will still play, but the vehicle won't change at all.
statictransformToSubmarine(vehicle:Dynamic, instantly:Bool):Dynamic
Transforms the stormberg to its "water vehicle" variant. If the vehicle is already in that state then the vehicle transformation audio will still play, but the vehicle won't change at all.