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)
Question
deon
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
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 accountSign in
Already have an account? Sign in here.
Sign In Now