Nikolay_888 Posted August 18, 2015 Share Posted August 18, 2015 --server function createVehicleForPlayer(thePlayer, command, vehicleModel) local x,y,z = getElementPosition(thePlayer) x = x + 5 local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z) end addCommandHandler("cv", createVehicleForPlayer) function gVehicleStartEnter (player, seat) if seat == 0 and getVehicleOccupant (source, 0) then cancelEvent () outputChatBox ('stop it', player) end end addEventHandler ('onVehicleStartEnter', root, gVehicleStartEnter, _, 'high') When I try to enter to empty created vehicle, event cancelled. And i try to modify eventHandler like this: function gVehicleStartEnter (player, seat) if seat == 0 and getVehicleOccupant (source, 0) then cancelEvent () outputChatBox ('stop it', getVehicleOccupant (source, 0)) end end addEventHandler ('onVehicleStartEnter', root, gVehicleStartEnter, _, 'high') And now it output chat message to me What is wrong? Link to comment
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