Jonas^ Posted December 14, 2018 Share Posted December 14, 2018 (edited) Olá pessoal, bom estava dando uma olhadinha na wiki pra ver se tem algo relacionado a ocultar a bindkey de uma tecla se o jogador não estiver na ACL x, exemplo: ACL1 - Teria acesso a bindkey m pra enviar mensagens com tag no chat. ----------------- Agora se o jogador não estiver na ACL1 e se ele pressionar a tecla 'M' nada acontece, não iria abrir o chat nem nada, tipo um 'cancelevent' OBS: A bindkey esta no lado client. Edited December 14, 2018 by OverKILL Link to comment
[M]ister Posted December 15, 2018 Share Posted December 15, 2018 -- client side function teste() outputChatBox("estou na acl") end addEvent( "addBind", true ) addEventHandler( "addBind", localPlayer, function() bindKey ( "M", "up", teste ) end ) addEventHandler( "onClientResourceStart", resourceRoot, function() if getKeyBoundToFunction( teste ) ~= "M" then triggerServerEvent ( "upRequest", localPlayer ) end end ) -- server side addEventHandler ( "onResourceStart", resourceRoot, function() for _, thePlayer in ipairs(getElementsByType("player")) do if estaAcl(thePlayer,"BOPE") then triggerClientEvent ( thePlayer, "addBind", thePlayer ) end end end ) addEventHandler("onPlayerLogin", root, function() local thePlayer = source if estaAcl(thePlayer,"BOPE") then triggerClientEvent ( thePlayer, "addBind", thePlayer ) end end ) function estaAcl(thePlayer, acl) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( acl ) ) then return true end return false end addEvent( "upRequest", true ) addEventHandler( "upRequest", root, function() local thePlayer = client if estaAcl(thePlayer,"BOPE") then triggerClientEvent ( thePlayer, "addBind", thePlayer ) end end ) 1 Link to comment
Jonas^ Posted December 15, 2018 Author Share Posted December 15, 2018 Funcionou perfeitamente, obrigado malignos. 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