Jump to content

Taxi help


Wei

Recommended Posts

How can I make that when player will join the car as passenger it will take him money and give it to the driver for every mile or km.

CODE:

setTeamFriendlyFire(teamtaxi, false) 
  
teamtaxi = createTeam ( "Taxi Drivers", 255, 255, 0 ) 
  
function taxiCommand ( thePlayer, command ) 
  destroyElement ( taxiOphaalBlip ) 
  taxiOphaalBlip = createBlipAttachedTo ( thePlayer, 48, 1, 255, 0, 0, 0, 0, 99999.0, getRootElement() ) 
  outputChatBox ("Car on the road, stay put!", thePlayer, 255, 190, 0, false ) 
  outputChatBox ("Someone called taxi!", getRootElement(), 255, 190, 0, false ) 
end 
addCommandHandler ( "calltaxi", taxiCommand ) 
  
function taxiCancelCommand ( thePlayer, command ) 
  outputChatBox ("Remember to turn off.", thePlayer, 255, 190, 0, false ) 
  outputChatBox ("as taxi job done!", getRootElement(), 255, 190, 0, false ) 
  destroyElement ( taxiOphaalBlip ) 
end 
addCommandHandler ( "taxicancel", taxiCancelCommand ) 
  
taxiVehicles = { [420]=true } 
taxiSkins = { [7]=true } 
  
function taxienterVehicle ( player, seat, jacked ) 
    if ( taxiVehicles[getElementModel ( source )] ) and ( not taxiSkins[getElementModel ( player )] ) and ( seat == 0 ) then 
        removePedFromVehicle ( player ) 
        outputChatBox ( "You are not a taxi driver, you can not drive this vehicle.", player ) 
    end 
end 
addEventHandler ( "onVehicleEnter", getRootElement(), taxienterVehicle ) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...