Require a specific vehicle for job

help

#1

Hi i am creating my own job system but need some help as i wanted to create a way were it requires you to use a specific vehicle and if you don’t have the required vehicle then you can not do the job.

I have look for natives that could do this but i have had no luck

Thanks in advanced.


#2

Untested but something like this could do the trick.

local requiredModel = GetHashKey("buffalo")

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(1)
		ped = PlayerPedId()	
		if IsPedInAnyVehicle(ped, true) then
			currentCar = GetVehiclePedIsIn(ped, false)
			carModel = GetEntityModel(currentCar)
			if IsVehicleModel(currentCar, requiredModel)
				print("Valid car")
			else
				print("Invalid car")
			end
		end
	end

end)

#3

Thank so much for the quick reply i am going to try and give it a go now :slightly_smiling_face: Thanks again.


#4

I wanted to use a trailer of my own as the required vehicle for my job system. Is there a way we could get it to check vehicle (Trailer) withing a blip or radius? :slight_smile:


#5

Anyone able to help? I would really appreciate the help :slight_smile:

Thanks in advanced


#6

I wanted to use a trailer of my own as the required vehicle for my job system. Is there a way we could get it to check vehicle (Trailer) withing a blip or radius? :slight_smile: