luck. Posted June 12, 2013 Share Posted June 12, 2013 hello I have an admin that works with chat / ac text, what I want to do is open the chatbox with bindkey, any idea? code: function adminchat(thePlayer, command, ...) local account = getPlayerAccount ( thePlayer ) local access = false for _, group in ipairs ( { "Admin", "Moderator", "SuperModerator" } ) do if isObjectInACLGroup ( "user." .. getAccountName(account), aclGetGroup (group) ) then access = true end end if not access then exports["Evo-notificaciones"]:showBox ( thePlayer, "error", " "..getPlayerName(thePlayer).."Acceso Denegado.") return end local word = {...} local message = table.concat(word, " ") for i, v in ipairs ( getElementsByType ( "player" ) ) do account = getPlayerAccount ( v ) access = false for _, group in ipairs ( { "Admin", "Moderator", "SuperModerator" } ) do if isObjectInACLGroup ( "user." .. getAccountName(account), aclGetGroup (group) ) then access = true end end if access then outputChatBox ( "#ff0000( #ffffffAdmin Chat #ff0000)#FFFFFF " .. getPlayerName ( thePlayer ) .. "#ffffff: " .. message, v, 255, 255, 255, true ) end end end addCommandHandler ( "ac", adminchat ) Link to comment
Castillo Posted June 12, 2013 Share Posted June 12, 2013 Just bind the key, instead of a command. Link to comment
luck. Posted June 12, 2013 Author Share Posted June 12, 2013 I tried the following I had no more success bindKey("u","down","chatbox",adminchat) Link to comment
Castillo Posted June 12, 2013 Share Posted June 12, 2013 Server side bindKey requires a player element, bind it when you join, and when resource starts for all players. Link to comment
xXMADEXx Posted June 12, 2013 Share Posted June 12, 2013 Server side bindKey requires a player element, bind it when you join, and when resource starts for all players. There fore, you can make the bind on the Client side, and trigger a server event, or you can make a loop to bind the key when the resource starts (If you use this method, make sure to bind the key onPlayerJoin also.) 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