Jump to content

[HELP] getACLgroup problem!


NeW

Recommended Posts

Posted

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.

Posted (edited)

can you explane your problem better

You don't need to use ACL group simply you can add Police Team.

Edited by Guest

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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

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