Apo Posted April 19, 2016 Share Posted April 19, 2016 hi guys please help me for fix my script if player enter the car id 411 and 602 and 593 if not license remove player in the car function licensecheck(thePlayer) local carlicense = getElementData(thePlayer, "license") local seat = getPedOccupiedVehicleSeat(thePlayer) if (carlicense == 1 ) and (seat==0) then else outputChatBox("You are not a driver license", thePlayer, 255, 0, 0) removePedFromVehicle(thePlayer) local x, y, z = getElementPosition(thePlayer) setElementPosition(thePlayer, x, y, z) return end end addEventHandler("onVehicleEnter", getRootElement(), licensecheck) Link to comment
aka Blue Posted April 19, 2016 Share Posted April 19, 2016 First check if the player got the License, if doesn't, cancelEvent () and a message. Link to comment
Seba500PLK Posted April 19, 2016 Share Posted April 19, 2016 LicenseVehicles = { [411]=true, [602]=true, [593]=true } function licensecheck(thePlayer, seat) local carlicense = getElementData(thePlayer, "license") if (carlicense == 1 ) and (seat == 0) then else if (LicenseVehicles[getElementModel ( source )]) outputChatBox("You are not a driver license", thePlayer, 255, 0, 0) removePedFromVehicle(thePlayer) end end end addEventHandler("onVehicleEnter", getRootElement(), licensecheck) 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