Multi Posted November 22, 2013 Share Posted November 22, 2013 Hello. I try to make script that if you dont have a drving licence then you can t enter the vehicle of this ids. policeVehicles = { [598]=true,[596]=true,[597]=true,[599]=true } function enterVehicle ( player, seat, jacked, thePlayer ) kon = getPlayerAccount(thePlayer) if policeVehicles(getElementModel(source) ) then if not getAccountData(kon,"prawko2") == "zajety" ) then cancelEvent() outputChatBox ( "Only if you have a licence car", player ) end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) and something is not working can u help me ?? Link to comment
Tete omar Posted November 22, 2013 Share Posted November 22, 2013 Try this: policeVehicles = { [ 598 ] = true, [ 596 ] = true, [ 597 ] = true, [ 599 ] = true } function enterVehicle ( player, seat, jacked ) local kon = getPlayerAccount ( player ) if ( policeVehicles [ getElementModel ( source ) ] ) then if ( not getAccountData ( kon, "prawko2" ) == "zajety" ) then cancelEvent ( ) outputChatBox ( "Only if you have a licence car", player ) end end end addEventHandler ( "onVehicleStartEnter", root, enterVehicle ) Link to comment
Multi Posted November 22, 2013 Author Share Posted November 22, 2013 its not working ;// Link to comment
Multi Posted November 22, 2013 Author Share Posted November 22, 2013 debug nothing ;/ i try server side and client side Link to comment
TAPL Posted November 22, 2013 Share Posted November 22, 2013 policeVehicles = { [ 598 ] = true, [ 596 ] = true, [ 597 ] = true, [ 599 ] = true } function enterVehicle ( player, seat, jacked ) local kon = getPlayerAccount ( player ) if ( policeVehicles [ getElementModel ( source ) ] ) then if (getAccountData ( kon, "prawko2" ) ~= "zajety" ) then cancelEvent ( ) outputChatBox ( "Only if you have a licence car", player ) end end end addEventHandler ( "onVehicleStartEnter", root, enterVehicle ) 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