ScriptsAboutBlogToolsKnowledge BaseReviewsFAQBasketDocsSupport
shared

GetEntityModel

FiveM shared native documentation with a Lua example.

Summary

Returns the model hash of an entity. Used to check what kind of vehicle/ped/object something is.

Returns

Hash — the model hash.

Parameters

entitynumberThe entity handle.

Example

local model = GetEntityModel(veh)
if model == `police` then
  -- it's a police cruiser
end

Common pitfalls

  • Compare against backtick-hashed literals (police) for readability.
  • Works on any entity type.

Related natives

Related guides

Managing jobs on your server?

Viper Multi-Job lets players hold several jobs and switch between them with grade, salary and duty handled — QBCore, QBox and ESX, validated server-side.

See Viper Multi-Job →