NeW Posted May 10, 2015 Share Posted May 10, 2015 policeVehicles = { [598]=true, [596]=true, [597]=true, [599]=true } policeSkins = { [280]=true, [281]=true, [282]=true, [283]=true, [284]=true, [285]=true, [286]=true } function enterVehicle ( theVehicle, seat, jacked ) --when a player enters a vehicle if ( policeVehicles[getElementModel ( theVehicle )] ) and ( not policeSkins[getElementModel ( source )] ) then -- if the vehicle is one of 4 police cars, and the skin is not a police skin if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Police" ) ) then removePedFromVehicle ( source ) -- force the player out of the vehicle outputChatBox ( "Only policeman can enter police cars!", source ) -- and tell the player why end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), enterVehicle ) -- add an event handler for onPlayerVehicleEnter I would like to add ACLs "police" , but it does not work... Can you make a working? Thanks. Link to comment
Walid Posted May 10, 2015 Share Posted May 10, 2015 (edited) can you explane your problem better You don't need to use ACL group simply you can add Police Team. Edited May 10, 2015 by Guest Link to comment
WhoAmI Posted May 10, 2015 Share Posted May 10, 2015 policeVehicles = { [598]=true, [596]=true, [597]=true, [599]=true } policeSkins = { [280]=true, [281]=true, [282]=true, [283]=true, [284]=true, [285]=true, [286]=true } function enterVehicle ( player, seat ) if ( policeVehicles[getElementModel ( source )] ) and ( not policeSkins[getElementModel ( player )] ) then if not isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Police" ) ) then outputChatBox ( "Only policeman can enter police cars!", player ) cancelEvent ( ) end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), 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