Dekonpriv Posted July 22, 2023 Posted July 22, 2023 I would like to know if it is possible to create a command to add or remove players from the ACL, for example, putting John in the police ACL. Example: /givePolice john /give gang john or take John off the ACL. Example: /removePolice john /remove gang john Briefly: you type the command /givePolice john and the message "you added the player in the Police" will appear or /removePolice and it will say "you removed the Police player"
FlorinSzasz Posted July 22, 2023 Posted July 22, 2023 Yes u can do that but u need to add this groups to acl, like u need to create these groups, but also u can create teams! https://wiki.multitheftauto.com/wiki/CreateTeam Also u can create a database with tables and save in which table who is from what faction/ gang.
_SAXI_ Posted July 22, 2023 Posted July 22, 2023 function addPlayerToACLGroup(player,groupName) local account=getPlayerAccount(player); local group=aclGetGroup(groupName); if not(isGuestAccount(account))then if(group)then return aclGroupAddObject(group,"user."..getAccountName(account)); end end return false end function removePlayerFromACLGroup(player,groupName) local account=getPlayerAccount(player); local group=aclGetGroup(groupName); if not(isGuestAccount(account))and(group)then local accountName=getAccountName(account); if(isObjectInACLGroup("user"..accountName,group))then return aclGroupRemoveObject(group,"user."..accountName); end end return false end addCommandHandler("givePolice",function(admin,_,playerName) if(hasObjectPermissionTo(admin,"general.ModifyOtherObjects"))then local player=getPlayerFromName(playerName); if(player)then addPlayerToACLGroup(player,"police"); end end end); addCommandHandler("removePolice",function(admin,_,playerName) if(hasObjectPermissionTo(admin,"general.ModifyOtherObjects"))then local player=getPlayerFromName(playerName); if(player)then removePlayerFromACLGroup(player,"police"); end end end); addCommandHandler("give",function(admin,_,groupName,playerName) if(hasObjectPermissionTo(admin,"general.ModifyOtherObjects"))then local group=aclGetGroup(groupName); local player=getPlayerFromName(playerName); if(group)and(player)then addPlayerToACLGroup(player,group); end end end); addCommandHandler("remove",function(admin,_,groupName,playerName) if(hasObjectPermissionTo(admin,"general.ModifyOtherObjects"))then local group=aclGetGroup(groupName); local player=getPlayerFromName(playerName); if(group)and(player)then removePlayerFromACLGroup(player,group); end end end); I haven't tried this, but it should work. By default it is made for administrators who can assign groups in the acl, by default it would be for the "Admin" group
#!_A7M8D Posted July 26, 2023 Posted July 26, 2023 Hello you can create ACL Groups For Example "Police" then checks if his account in this group or not local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Police" ) ) then end Cheers!
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