-- This example checks if the player is in a Cargobob and if the Cargobob can pick up the specified entity.
-- Retrieve the player ped.
local playerPed = PlayerPedId()
-- Retrieve the player's vehicle (cargobob).
local cargobob = GetVehiclePedIsIn(playerPed, false)
-- Retrieve the model hash of the cargobob.
local model = GetEntityModel(cargobob)
-- Check if the vehicle exists and if it's a Cargobob. If not, terminate the script.
if not DoesEntityExist(cargobob) or GetHashKey("cargobob") ~= model then
return
end
local entityID = 15362 -- The entity you want to check if the Cargobob can pick up (this is a random entity ID).
-- Check if the entity exists. If not, terminate the script.
if not DoesEntityExist(entityID) then
return
end
-- Check if the Cargobob can pick up the specified entity.
if CanCargobobPickUpEntity(vehicle, entityID) then
print("Cargobob can pick up the specified entity")
else
print("Cargobob can't pick up the specified entity")
end