SetTransformToSubmarineUsesAlternateInput
DocsSetTransformToSubmarineUsesAlternateInput(vehicle, useAlternateInput)Description
Introduced in build 1365
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').
Parameters
| Name | Type | Description |
|---|---|---|
vehicle | Vehicle | The vehicle for which the submarine mode should be configured. |
useAlternateInput | bool | A boolean switch to enable/disable the use of alternate input. |
Quick Snippet: Get Vehiclevehicle
vehicleUse this to get the current vehicle handle for this native.
-- Get the vehicle the player is currently in
local ped = PlayerPedId()
local vehicle = GetVehiclePedIsIn(ped, false)
if vehicle ~= 0 then
print("Vehicle handle: " .. vehicle)
print("Model: " .. GetEntityModel(vehicle))
else
print("Player is not in a vehicle")
endVehicle Models

adder
alpha
blade
ardent
asea
cogcabrio
baller
blistaReturns
voidThis native does not return a value.
Examples
Official
-- This example sets the key for submarine mode transformation to special vehicle transform
-- Retrieve the player ped
local playerPed = PlayerPedId()
-- Retrieve the vehicle in which the player is currently seated
local vehicle = GetVehiclePedIsIn(playerPed, false)
-- Retrieve the vehicle model hash
local vehicleHash = GetEntityModel(vehicle)
-- Check if the vehicle exists in the game world and if it is a Stromberg.
if not DoesEntityExist(vehicle) or not vehicleHash == GetHashKey("stromberg") then
-- If the vehicle does not exist or it's not a stromberg, end the execution of the code here.
return
end
-- Set the key for submarine mode transformation to special vehicle transform (X by default)
SetTransformToSubmarineUsesAlternateInput(vehicle, true)