| Property | Value |
|---|---|
| Native Name | CAN_CARGOBOB_PICK_UP_ENTITY |
| Hash | 0x2C1D8B3B19E517CC |
| Return Type | BOOL |
| Parameters | cargobob (Vehicle), entity (Entity) |
Description: Determines whether the specified Cargobob can pick up a given entity.
Parameters
cargobob(Vehicle) — The Cargobob helicopter to be checked.entity(Entity) — The entity to be checked for pick-up.
Examples
-- 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
// This example checks if the player is in a Cargobob and if the Cargobob can pick up the specified entity.
// Retrieve the player ped.
const playerPed = PlayerPedId();
// Retrieve the player's vehicle (cargobob).
const cargobob = GetVehiclePedIsIn(playerPed, false);
// Retrieve the model hash of the cargobob.
const model = GetEntityModel(cargobob);
// Check if the vehicle exists and if it's a Cargobob. If not, terminate the script.
if (!DoesEntityExist(cargobob) || GetHashKey("cargobob") !== model) {
return;
}
const 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 (!DoesEntityExist(entityID)) {
return;
}
// Check if the Cargobob can pick up the specified entity.
if (CanCargobobPickUpEntity(vehicle, entityID)) {
console.log("Cargobob can pick up the specified entity");
} else {
console.log("Cargobob can't pick up the specified entity");
}
// This example checks if the player is in a Cargobob and if the Cargobob can pick up the specified entity.
using static CitizenFX.Core.Native.API;
// Retrieve the player ped.
int playerPed = PlayerPedId();
// Retrieve the player's vehicle (cargobob).
int cargobob = GetVehiclePedIsIn(playerPed, false);
// Retrieve the model hash of the cargobob.
uint model = GetEntityModel(cargobob);
// Check if the vehicle exists and if it's a Cargobob. If not, terminate the script.
if (!DoesEntityExist(cargobob) || model != (uint)GetHashKey("cargobob")) {
return;
}
int 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 (!DoesEntityExist(entityID)) {
return;
}
// Check if the Cargobob can pick up the specified entity.
if (CanCargobobPickUpEntity(vehicle, entityID)) {
Debug.WriteLine("Cargobob can pick up the specified entity");
} else {
Debug.WriteLine("Cargobob can't pick up the specified entity");
}