SetEntityVisible
DocsSetEntityVisible(entity, toggle, unk)Description
Toggle the visibility of a given entity.
Parameters
| Name | Type | Description |
|---|---|---|
entity | Entity | The entity to change the visibility of |
toggle | BOOL | Whether or not the entity will be visible |
unk | BOOL | Always 0 in scripts |
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
endReturns
voidThis native does not return a value.
Examples
Official
SetEntityVisible(PlayerPedId(), false, 0)