Jump to content
  • 0

First scripts


deon

Question

So, the idea of my script is like that: if player comes to the marker the taxi cars spawns and the key "h" binds for outputchatbox "Work now". 

The problem is that it doesn't work. I mean the bind doesn't work despite car spawns. How can I fix it? Please help me ?

 

Code: 

local TaxiJob = createMarker (-2405, -596, 131.7, "cylinder", 1.0, 123, 125, 225, 100)
function Taxi(e, dim)
    if getElementType(e) == "player" then
        createVehicle(420, -2398.01050, -592.51874, 132.64844)
        function bindTheKeys(e, commandName)
            if isPedInVehicle(e) then
                bindKey(e, "h", "down", FuncInput)
            end
        end
        addEventHandler("bindme", bindTheKeys)
    end
end
function FuncInput(e, key, keyState)
    outputChatBox("Work now")
end
addEventHandler("onMarkerHit", TaxiJob, Taxi)

Link to comment

1 answer to this question

Recommended Posts

  • 0

I've changed my code a bit but it still doesn't work

 

local TaxiJob = createMarker (-2405, -596, 131.7, "cylinder", 1.0, 123, 125, 225, 100)
function functionout(e, key, keyState)
    outputChatBox("112")
end
function Taxi(e, dim)
    if getElementType(e) == "player" then
        createVehicle(420, -2398.01050, -592.51874, 132.64844)
        function binder(e, commandName)
            if isPedInVehicle(e) then
                bindKey(e, "]", "down", functionout)
            end
        end
        addCommandHandler("bindme", binder)
    end
end
addEventHandler("onMarkerHit", TaxiJob, Taxi)

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