Jump to content

Ajuda?? Painel B por ACL


Recommended Posts

Irá ter de alterar algumas linhas na função que é ativada pela bind "b" e integrar o seguinte codigo no resource !

 

-- server

function isPlayerInACL(player, acl)
   local accountName = getAccountName( getPlayerAccount(player) )
   if accountName ~= "guest" and type( aclGetGroup(acl) ) == "userdata" then
      return isObjectInACLGroup( "user."..accountName, aclGetGroup(acl) )
   end
   return false
end

function checkPermission ( acl )
	local result = isPlayerInACL(client, acl)
	triggerClientEvent ( client, "resultPermisson", client, result )
end
addEvent( "onCheckPermission", true )
addEventHandler( "onCheckPermission", resourceRoot, checkPermission )

-- client 
function switch(result)
	if result then
    	-- chamar função de abrir o painel
    else
    	outputChatBox("Não tem permissão")
    end
end
addEvent( "resultPermisson", true )
addEventHandler( "resultPermisson", localPlayer, switch )
function requestP()
	triggerServerEvent ( "onCheckPermission", resourceRoot, "Admin" )  -- indicar aqui a acl 
end
bindKey("b", "down", requestP)

 

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