Jump to content

Admin chat bindkey


xeon17

Recommended Posts

How i can make my admin chat to work by bindkey ''‚'' ( ‚ )

  
  
function adminchat ( thePlayer, _, ... ) 
    local message = table.concat ( { ... }, " " ) 
local account = getPlayerAccount(thePlayer) 
         if (not account or isGuestAccount(account)) then return end 
         local accountName = getAccountName(account) 
         for i, v in pairs ( acls ) do 
         if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( v ) ) ) then 
   if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "ORGANIZADOR" ) )) then 
    outputChatBox ( "#FF0000[Organizador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) 
            end 
      if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "MODERADOR" ) )) then 
    outputChatBox ( "#FF0000[Moderador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) 
end 
      if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "ADMINISTADOR" ) )) then 
    outputChatBox ( "#FF0000[Administrador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) 
end 
      if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "COLABORADOR" ) )) then 
    outputChatBox ( "#FF0000[Colaborador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) 
end 
if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "Console" ) )) then 
    outputChatBox ( "#FF0000[Console] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) 
end 
end 
end 
end 
addCommandHandler ( "ac", adminchat ) 
  
  

I tried but dosen't work ,help Et-win :DDDDD

Link to comment
local acls = { "ORGANIZADOR", "MODERADOR", "ADMINISTADOR", "COLABORADOR", "Console" } 
  
  
  
  
  
function adminchat ( thePlayer, _, ... ) 
    local message = table.concat ( { ... }, " " ) 
local account = getPlayerAccount(thePlayer) 
         if (not account or isGuestAccount(account)) then return end 
         local accountName = getAccountName(account) 
         for i, v in pairs ( acls ) do 
         if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( v ) ) ) then 
   if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "ORGANIZADOR" ) )) then 
    outputChatBox ( "#FF0000[Organizador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) 
            end 
      if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "MODERADOR" ) )) then 
    outputChatBox ( "#FF0000[Moderador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) 
end 
      if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "ADMINISTADOR" ) )) then 
    outputChatBox ( "#FF0000[Administrador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) 
end 
      if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "COLABORADOR" ) )) then 
    outputChatBox ( "#FF0000[Colaborador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) 
end 
if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "Console" ) )) then 
    outputChatBox ( "#FF0000[Console] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) 
end 
end 
end 
end 
addCommandHandler ( "ac", adminchat ) 
  
  
  
function isAllownedPlayer(player) 
    local account = getPlayerAccount(player) 
    if (not account or isGuestAccount(account)) then return false end 
    local accountName = getAccountName(account) 
    for i, v in pairs ( acls ) do 
        if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( v ) ) ) then 
            return true 
        end 
    end 
  
    outputChatBox("#FFF000[sERVER]#FFFFFF You aren't an admin.", player, 255,255,255, true) 
    return false 
end 
  
bindKey ( source, u , "down", "chatbox", function ); 
  

:oops:

Link to comment

It's first time i work with bindkey and this stuff , i don't understand how it work...

  
function Bind ( source ) 
if not (isAllownedPlayer(source)) then return end 
bindKey ( source, adminchat , "down", "chatbox", bind ) 
end 
addEventHandler("onPlayerLogin", root, Bind) 

Link to comment
--serverside ,

addEventHandler ( 'onPlayerLogin', resourceRoot, 
function ( player ) 
if not ( isAllownedPlayer(player)) then return end 
bindKey ( player, 'u', 'down', 'chatbox', adminchat ) 
   end 
) 

Never try to help anyone when you don't even know the basics.

Link to comment
  • 3 weeks later...

I tried this but dosen't work

addEventHandler ( 'onPlayerJoin', root, 
function () 
bindKey ( source, 'u', 'down', 'chatbox', adminchat ) 
   end) 

bug:

[2014-08-30 17:03:26] WARNING: (GW)Admin-Chat\admin-chat.lua:38: Bad argument @ 'bindKey' [Expected string at argument 5, got function] 

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