Is there any way to check what vehicle type a player is trying to enter? For example check if the ped is trying to enter a bike or a car. Even if that means that I have to setup arrays with the vehicle models.
Thanks!
Is there any way to check what vehicle type a player is trying to enter? For example check if the ped is trying to enter a bike or a car. Even if that means that I have to setup arrays with the vehicle models.
Thanks!
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local vehicle = GetVehiclePedIsIn(GetPlayerPed(-1), false)
local vehicleClass = GetVehicleClass(vehicle)
if vehicleClass == 13 then -- class #13 are bicycles
--do something
else --if the vehicleClass is not bicycles
--do something else
end
end
end)
id = 0 --compacts
id = 1 --sedans
id = 2 --SUV's
id = 3, --coupes
id = 4 --muscle
id = 5 --sport classic
id = 6 --sport
id = 7 --super
id = 8 --motorcycle
id = 9 --offroad
id = 10 -industrial
id = 11-utility
id = 12--vans
id = 13 --bicycles
id = 14 --boats
id = 15, --helicopter
id = 16 --plane
id = 17 --service
id = 18 --emergency
id = 19 --military