Skip to content

Commit

Permalink
feat(entityCreated): isVehicle variable
Browse files Browse the repository at this point in the history
  • Loading branch information
artur-michalak committed Aug 29, 2024
1 parent be3de5f commit 87095ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ AddEventHandler('entityCreated', function (entity)

local type = GetEntityType(entity)
local isPed = type == EntityType.Ped
if not (isPed or type == EntityType.Vehicle) then return end
local isVehicle = type == EntityType.Vehicle
if not (isPed or isVehicle) then return end
local vehicle = isPed and GetVehiclePedIsIn(entity, false) or entity

if not DoesEntityExist(vehicle) then return end -- ped can be not in vehicle, so we need to check if vehicle is a entity, otherwise it will return 0
Expand Down

0 comments on commit 87095ee

Please sign in to comment.