Black2 Posted July 16, 2015 Share Posted July 16, 2015 Why this don't work ? function onVehicleEnter ( thePlayer ) if ( not Barcos [ getElementModel ( source ) ] ) then return end local occupation = getElementData( source, "Occupation", "Fisherman", true ) if occupation and occupation ~= "" then if (occupation == "Fisherman" ) then getNewBarcoLocation ( thePlayer ) end end end addEventHandler ( "onVehicleEnter", root, onVehicleEnter ) Link to comment
xXMADEXx Posted July 16, 2015 Share Posted July 16, 2015 There's a lot of errors in that. Try using this and if it still doesn't work check debugscript (/debugscript 3) function onVehicleEnter ( thePlayer ) if ( not Barcos [ getElementModel ( source ) ] ) then return end local occupation = tostring ( getElementData( thePlayer, "Occupation" ) ) if ( occupation == "Fisherman" ) then getNewBarcoLocation ( thePlayer ) end end addEventHandler ( "onVehicleEnter", root, onVehicleEnter ) 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