GetIsBoatCapsized
Docslocal retval = GetIsBoatCapsized(vehicle)Description
Checks whether the specified boat vehicle is capsized, meaning it has overturned or is upside down in the water.
Parameters
| Name | Type | Description |
|---|---|---|
vehicle | Vehicle | The vehicle to check. This should be a boat-type vehicle. |
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
BOOLReturns TRUE (1) or FALSE (0).
Examples
Official
-- This example checks if the player is in a boat and if the boat is capsized.
-- Retrieve the LocalPlayer.
local playerPed = PlayerPedId()
-- Retrieve the vehicle the player is in
local vehicle = GetVehiclePedIsIn(playerPed, false)
-- Retrieve the model of the vehicle
local vehicleModel = GetEntityModel(vehicle)
-- Check if the vehicle exists in the game world.
if not DoesEntityExist(vehicle) then
-- If the vehicle does not exist, end the execution of the code here.
return
end
-- Check if the vehicle is a boat.
if not IsThisModelABoat(vehicleModel) then
-- If the vehicle is not a boat, end the execution of the code here.
return
end
-- Check if the boat is capsized.
if GetIsBoatCapsized(vehicle) then
print("The boat is capsized!")
else
print("The boat is not capsized!")
end