KingBC

Help in Job Taxi/Uber

Recommended Posts

I wanted to create a taxi/uber job that the passenger/player (not NPC) would be charged after getting off the vehicle.
How can I do this?

Share this post


Link to post
TaxiCars = { -- valid Vehicle ID's
	[420] = true,
	[438] = true
}

function enterTaxiVehicle(player,seat)
	local taxiVehicle = getPedOccupiedVehicle ( player )
	local taxiVehicleID = getVehicleID(taxiVehicle)
	
	if TaxiCars[taxiVehicleID] == true then
		if taxiDriver == true and seat == 0 then
			cancelEvent(true,nil)
			return false
		end

		local taxiDriver = getVehicleOccupant ( player )

		if taxiDriver == true then
			takePlayerMoney(player,500)
			givePlayerMoney(taxiDriver,500)
		else
			cancelEvent(true,nil)
		end
	end
end
addEventHandler("onVehicleStartEnter",getRootElement(),enterTaxiVehicle)

 

I dont test it.

Edited by PSWGM9100

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.