SetEntityAlpha
DocsSetEntityAlpha(entity, alphaLevel, skin)Description
This native sets the entity's alpha level.
Parameters
| Name | Type | Description |
|---|---|---|
entity | Entity | The entity to change the alpha for. |
alphaLevel | int | The alpha level ranges from 0 to 255, but changes occur every 20% (every 51). |
skin | BOOL | Whether or not to change the alpha of the entity's skin. |
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
SetEntityAlpha(PlayerPedId(), 51, false)