-- 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)