P4RK0UR Posted January 19, 2014 Posted January 19, 2014 addEventHandler( "onVehicleStartEnter", root, function ( enteringPlayer ) local skin = getElementModel ( enteringPlayer ) if ( getElementModel ( source ) == 520 or 425 ) and not ( skin == 287 or skin == 217 ) then cancelEvent( ) outputChatBox("You must be in Army to enter the vehicle!",enteringPlayer,255,0,0,true) end end ) This to me seems fine but when i enter a cop car with a cop it tells me i must be in the Army! WTF? i though this script only counted towards the hydra and the hunter for the admin skin and army skin. Please tell me what i am doing wrong and kindly correct me
Gallardo9944 Posted January 19, 2014 Posted January 19, 2014 (edited) addEventHandler( "onVehicleStartEnter", root, function ( enteringPlayer ) local skin = getElementModel ( enteringPlayer ) if ( getElementModel ( source ) == 520 or getElementModel ( source ) == 425 ) and not ( skin == 287 or skin == 217 ) then cancelEvent( ) outputChatBox("You must be in Army to enter the vehicle!",enteringPlayer,255,0,0,true) end end ) Because you use "getElementModel ( source ) == 520 or 425", but it doesn't check the model for both 520 and 425. It checks if the model is 520 and if a VALUE 425 exists (it always does though) Edited January 19, 2014 by Guest
Castillo Posted January 19, 2014 Posted January 19, 2014 addEventHandler ( "onVehicleStartEnter", root, function ( enteringPlayer ) local skin = getElementModel ( enteringPlayer ) local model = getElementModel ( source ) if ( model == 520 or model == 425 and skin ~= 287 and skin ~= 217 ) then cancelEvent ( ) outputChatBox ( "You must be in Army to enter the vehicle!", enteringPlayer, 255, 0, 0, true ) end end )
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