From 87095eeeddb6778d22506dc77dad7f2da1ff5026 Mon Sep 17 00:00:00 2001 From: ArturMichalak Date: Thu, 29 Aug 2024 23:13:56 +0200 Subject: [PATCH] feat(entityCreated): isVehicle variable --- server/main.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index 752a697..02b9439 100644 --- a/server/main.lua +++ b/server/main.lua @@ -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