Added config option to only auto lock speeds if it's a player

This commit is contained in:
Dan
2021-01-07 10:50:52 +00:00
parent 47fa80d67b
commit a166dda1cb
3 changed files with 27 additions and 3 deletions

View File

@@ -111,6 +111,19 @@ function UTIL:GetEntityRelativeDirection( myAng, tarAng )
return 0
end
-- Returns if there is a player in the given vehicle
function UTIL:IsPlayerInVeh( veh )
for i = -1, GetVehicleMaxNumberOfPassengers( veh ) + 1, 1 do
local ped = GetPedInVehicleSeat( veh, i )
if ( DoesEntityExist( ped ) ) then
if ( IsPedAPlayer( ped ) ) then return true end
end
end
return false
end
-- Your everyday GTA notification function
function UTIL:Notify( text )
SetNotificationTextEntry( "STRING" )