Jump to content

working taxi driver


Estevam2d

Recommended Posts

I am creating the taxi driver working , I get money but not remove the passenger

someone help me ?

side-server

function test(client) 
local vehicle = getPedOccupiedVehicle( client ) 
local driver = getVehicleController( vehicle ) 
    timer = setTimer(function() 
     givePlayerMoney( driver, 1) 
     takePlayerMoney ( vehicle, 1 ) -- not cut passenger money 
    end,2000,0) 
  
end 
addEventHandler("onVehicleStartEnter",getRootElement(),test) 

Link to comment

was, it is true, thank you :lol::D:)

function test(player) 
if isPedInVehicle( player ) then 
            if getElementType ( player ) == "player" then 
local vehicle = getPedOccupiedVehicle ( player ) 
teste = getVehicleController ( source ) 
            if  vehicle then 
       Controller = setTimer(takePlayerMoney, 2000, 0, player, 1) 
       Passageiro = setTimer(givePlayerMoney, 2000, 0, teste, 1) 
       end 
       end 
    end 
end 
addEventHandler("onVehicleStartEnter",getRootElement(),test) 

Link to comment

Fixed it up for you:

function cabi(player) 
    if isPedInVehicle( player ) then 
        if getElementType ( player ) == "player" then 
            local vehicle = getPedOccupiedVehicle ( player ) 
            if  vehicle then 
                local driver = getVehicleController ( vehicle ) 
                Controller = setTimer(takePlayerMoney, 2000, 0, player, 1) 
                Passageiro = setTimer(givePlayerMoney, 2000, 0, driver, 1) 
            end 
        end 
    end 
end 
addEventHandler("onVehicleStartEnter",getRootElement(),cabi) 

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...