CouDev Posted February 6, 2020 Share Posted February 6, 2020 (edited) ALGUM ERRO NO CONSOLE DIZ ASSIM attempt to call global 'isPlayerInACL' (a nil value), como faço para resolver? E também eu queria adicionar mais grupos que pudessem dar este comando /chat, exemplo Admin, Mod e outros function limparchat(source) if isPlayerInACL (source, "Console") then outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true ) outputChatBox( "#00FF00ᴏ ᴄʜᴀᴛ ғᴏɪ ʟɪᴍᴘᴏ ᴘᴏʀ #FFFF00"..getPlayerName(source).." #FF0000!!!", getRootElement(), 255, 255, 255, true) else outputChatBox ( "#00FF00Voce nao e da staff!!!", getRootElement(), 255, 255, 255, true ) end end addCommandHandler( "chat", limparchat ) Edited February 6, 2020 by CouDev Link to comment
Angelo Pereira Posted February 6, 2020 Share Posted February 6, 2020 (edited) --/> Exemplo para 2 Grupos ACL, Para Adicionar +, Adicione or isObjectInACLGroup ("user."..account, aclGetGroup ( "Console" )), igual abaixo : function limparchat( source ) local account = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup ("user."..account, aclGetGroup ( "Admin" )) or isObjectInACLGroup ("user."..account, aclGetGroup ( "Moderator" )) then outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox (" ", root, 255, 255, 255, true ) outputChatBox( "#00FF00ᴏ ᴄʜᴀᴛ ғᴏɪ ʟɪᴍᴘᴏ ᴘᴏʀ #FFFF00"..getPlayerName(source).." #FF0000!!!", root, 255, 255, 255, true) else outputChatBox ( "#00FF00Voce nao e da staff!!!", source, 255, 255, 255, true ) --/> Arrumado end end addCommandHandler( "chat", limparchat ) Edited February 6, 2020 by Angelo Pereira Link to comment
Jonas^ Posted February 6, 2020 Share Posted February 6, 2020 addCommandHandler ("chat", function (thePlayer, cmd) if (hasObjectPermissionTo (thePlayer, "command.mute", true)) then -- Se o jogador possuir permissão de mute, então: (Todos grupos padrões tem permissão de mute, então todos poderam usar o comando.) clearChatBox () -- Limpa o chat do servidor outputChatBox ("ᴏ ᴄʜᴀᴛ ғᴏɪ ʟɪᴍᴘᴏ ᴘᴏʀ #FFFF00"..getPlayerName(thePlayer).." #FF0000!!!", root, 0, 255, 0, true) else outputChatBox ("Voce nao e da staff!!!", thePlayer, 0, 255, 0) end end) 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