FiveM Docs / Native Reference
API Set:
  • all
  • server
  • client
Language:
  • raw
  • lua
  • c#
  • js
Namespace: CFXAPI set: clientGame: gta5editImprove

GET_TRAIN_DOOR_OPEN_RATIO

0x40B16551
// GetTrainDoorOpenRatio
float GET_TRAIN_DOOR_OPEN_RATIO(Vehicle train, int doorIndex);
Parameters:
  • train:

    The train to obtain the door ratio for.

  • doorIndex:

    Zero-based door index.

Returns:

A value between 0.0 (fully closed) and 1.0 (fully open).

Gets the ratio that a door is open for on a train.

Examples:

  • Lua
  • C#
local doorCount = GetTrainDoorCount(train)
for doorIndex = 0, doorCount - 1 do
    local ratio = GetTrainDoorOpenRatio(train, doorIndex)
    print("Door " .. tostring(doorIndex) .. " is open by a ratio of " .. tostring(ratio))
end
GET_PLAYER_WEAPON_DEFENSE_MODIFIER_2(Player playerId)
GET_RANDOM_VEHICLE_DENSITY_MULTIPLIER()
GET_REGISTERED_COMMANDS()
GET_RESOURCE_BY_FIND_INDEX(int findIndex)
GET_RESOURCE_KVP_FLOAT(char* key)
GET_RESOURCE_KVP_INT(char* key)
GET_RESOURCE_KVP_STRING(char* key)
GET_RESOURCE_METADATA(char* resourceName, char* metadataKey, int index)
GET_RESOURCE_PATH(char* resourceName)
GET_RESOURCE_STATE(char* resourceName)
GET_ROPE_FLAGS(int rope)
GET_ROPE_LENGTH_CHANGE_RATE(int rope)
GET_ROPE_TIME_MULTIPLIER(int rope)
GET_ROPE_UPDATE_ORDER(int rope)
GET_RUNTIME_TEXTURE_HEIGHT(long tex)
GET_RUNTIME_TEXTURE_PITCH(long tex)
GET_RUNTIME_TEXTURE_WIDTH(long tex)
GET_SCENARIO_PED_DENSITY_MULTIPLIER()
GET_SELECTED_PED_WEAPON(Ped ped)
GET_STATE_BAG_VALUE(char* bagName, char* key)
GET_TRAIN_CARRIAGE_ENGINE(Vehicle train)
GET_TRAIN_CARRIAGE_INDEX(Vehicle train)
GET_TRAIN_CURRENT_TRACK_NODE(Vehicle train)
GET_TRAIN_DOOR_COUNT(Vehicle train)
GET_TRAIN_DOOR_OPEN_RATIO(Vehicle train, int doorIndex)
GET_VEHICLE_ALARM_TIME_LEFT(Vehicle vehicle)
GET_VEHICLE_BODY_HEALTH(Vehicle vehicle)
GET_VEHICLE_CHEAT_POWER_INCREASE(Vehicle vehicle)
GET_VEHICLE_CLUTCH(Vehicle vehicle)
GET_VEHICLE_COLOURS(Vehicle vehicle, int* colorPrimary, int* colorSecondary)
GET_VEHICLE_CURRENT_GEAR(Vehicle vehicle)
GET_VEHICLE_CURRENT_RPM(Vehicle vehicle)
GET_VEHICLE_CUSTOM_PRIMARY_COLOUR(Vehicle vehicle, int* r, int* g, int* b)
GET_VEHICLE_CUSTOM_SECONDARY_COLOUR(Vehicle vehicle, int* r, int* g, int* b)
GET_VEHICLE_DASHBOARD_COLOUR(Vehicle vehicle, int* color)