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)