SetPickUpByCargobobDisabled
DocsSetPickUpByCargobobDisabled(entity, toggle)Description
Introduced in build 1180
Configures an entity to either allow or prevent it from being picked up by Cargobobs.
Parameters
| Name | Type | Description |
|---|---|---|
entity | Entity | The entity to be configured for pick up by Cargobob. |
toggle | BOOL | A boolean value where `true` prevents the entity from being picked up by Cargobobs, and `false` allows it. |
Quick Snippet: Get Entityentity
entityUse this to obtain an entity handle from the player's aim or crosshair.
-- Get the entity the player is aiming at
local ped = PlayerPedId()
local hit, entity = GetEntityPlayerIsFreeAimingAt(PlayerId())
if hit and entity ~= 0 then
print("Entity: " .. entity)
print("Model: " .. GetEntityModel(entity))
print("Type: " .. GetEntityType(entity)) -- 1=Ped, 2=Vehicle, 3=Object
endVehicle Models

adder
alpha
blade
ardent
asea
cogcabrio
baller
blistaReturns
voidThis native does not return a value.
Examples
Official
-- This example prevents a entity (in this example the vehicle of the player) from being picked up by any Cargobobs.
-- Retrieve the player ped
local playerPed = PlayerPedId()
-- Retrieve the player's vehicle (cargobob)
local vehicle = GetVehiclePedIsIn(playerPed, false)
-- 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
-- Prevent the vehicle from being picked up by Cargobobs.
SetPickUpByCargobobDisabled(vehicle, true)