Jump to content

[HELP] getACLgroup problem!


NeW

Recommended Posts

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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...