getElementType
Compartilhado
Lê o tipo de um elemento, como "player", "vehicle" ou o tipo dado em createElement.
string getElementType(element element)
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
| element | element | Elemento a ler. |
Retorno
O nome do tipo.
Tipos de elemento internos
- Árvore e sistema:
root,resource,console,file,db-connection - Mundo e cena:
player,ped,vehicle,object,colshape,ladder,effect,light,cinematic - Áudio:
sound,voice-channel - Renderização e assets:
texture,dx-font,render-target,screen-source,txd,dui,material,shader,model,drawable,col
Exemplo
addEventHandler("onElementDestroy", root, function()
if getElementType(source) == "vehicle" then
outputDebugString("um veículo foi destruído")
end
end)