TaskBoatMission
DocsTaskBoatMission(ped, boat, vehicleTarget, pedTarget, x, y, z, missionType, speed, drivingStyle, radius, missionFlags)Description
All parameters except ped and boat are optional, with pedTarget, vehicleTarget, x, y, z being dependent on missionType (ie. Attack/Flee mission types require a target ped/vehicle, whereas GoTo mission types require either x, y, z or a target ped/vehicle).
If you don't want to use a parameter; pass 0.0f for x, y and z, 0 for pedTarget, vehicleTarget and other int parameters, and -1.0f for the remaining float parameters.
enum eBoatMissionFlags
{
None = 0,
StopAtEnd = 1,
StopAtShore = 2,
AvoidShore = 4,
PreferForward = 8,
NeverStop = 16,
NeverNavMesh = 32,
NeverRoute = 64,
ForceBeached = 128,
UseWanderRoute = 256,
UseFleeRoute = 512,
NeverPause = 1024,
// StopAtEnd | StopAtShore | AvoidShore
DefaultSettings = 7,
// StopAtEnd | StopAtShore | AvoidShore | PreferForward | NeverNavMesh | NeverRoute
OpenOceanSettings = 111,
// StopAtEnd | StopAtShore | AvoidShore | PreferForward | NeverNavMesh | NeverPause
BoatTaxiSettings = 1071,
}Parameters
| Name | Type | Description |
|---|---|---|
ped | Ped | The ped to be tasked. |
boat | Vehicle | The boats' entity handle. |
vehicleTarget | Vehicle | The target vehicle (default is 0). |
pedTarget | Ped | The target ped (default is 0). |
x | float | The x coordinate of the target (default is 0.0f). |
y | float | The y coordinate of the target (default is 0.0f). |
z | float | The z coordinate of the target (default is 0.0f). |
missionType | int | The mission type (default is 0) (see [TaskVehicleMission](#\_0x659427E0EF36BCDE)). |
speed | float | The speed in m/s (default is -1.0f). |
drivingStyle | int | The driving style (default is 0) (see [SetDriveTaskDrivingStyle](#\_0xDACE1BE37D88AF67)). |
radius | float | The radius of when the task will be completed (default is -1.0f). |
missionFlags | int | The mission flags (default is 0) (see `eBoatMissionFlags`). |
Quick Snippet: Get Coordinatesxyz
xyzAdd this command to your client script to retrieve precise locations in-game.
-- Add this to your client.lua. Type /pos in-game to copy coords.
RegisterCommand('pos', function()
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
local heading = GetEntityHeading(ped)
local output = string.format("vector4(%.2f, %.2f, %.2f, %.2f)", coords.x, coords.y, coords.z, heading)
print(output)
TriggerEvent('chat:addMessage', { args = { '^4[COORD]^0', output } })
end)Quick Snippet: Get Ped HandlepedpedTarget
pedpedTargetUse this to get the player ped handle for this native.
-- Get the player's ped handle (client-side)
local ped = PlayerPedId()
print("Ped handle: " .. ped)
-- For a specific player's ped (server-side):
-- local targetPed = GetPlayerPed(source)Quick Snippet: Get VehicleboatvehicleTarget
boatvehicleTargetUse 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
blistaPed Models

mp_m_freemode_01
player_zero
ig_agatha
s_m_y_cop_01
s_m_m_gaffer_01
g_m_m_armboss_01
a_c_boar
a_m_m_bevhills_01Returns
voidThis native does not return a value.
Examples
Official
local boat_model = `tropic`
RequestModel(boat_model)
repeat Wait(0) until HasModelLoaded(boat_model)
-- Player needs to be in open water & in a boat for this to work
local ped = PlayerPedId()
local coords = GetEntityCoords(ped) - GetEntityForwardVector(ped) * 15.0
local vehicle = CreateVehicle(boat_model, coords.x, coords.y, coords.z, GetEntityHeading(ped), true, false)
-- Allow the game engine to clear the model from memory
SetModelAsNoLongerNeeded(boat_model)
local ped_model = `a_m_m_skater_01`
RequestModel(ped_model)
repeat Wait(0) until HasModelLoaded(ped_model)
local driver = CreatePedInsideVehicle(vehicle, 0, ped_model, -1, true, false)
-- Allow the game engine to clear the model from memory
SetModelAsNoLongerNeeded(ped_model)
TaskBoatMission(driver, vehicle, GetVehiclePedIsIn(ped, false), 0, 0.0, 0.0, 0.0, 7, -1.0, 786468, -1.0, 1044)
-- Mission Type: Follow | Drive Style: DrivingModeAvoidVehiclesReckless | Mission Flags: AvoidShore | NeverStop | NeverPause
SetPedKeepTask(driver, true)