gustavorn Posted June 22, 2013 Share Posted June 22, 2013 Hello, Well I want this command by typing / chat, it blocks the chat for users, but it does not. Could someone help me? I know I do not have many bugs may be something small, more like I always say. I can not keep looking because I have no time to even write the topic takes a lot more help, someone? function bbc(source) local accName = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then if blockc == true then outputChatBox("#FFFF00* GM "..getPlayerName(source).."#00FF00 normalizou o chat para demais usuários.", getRootElement(), 255, 255, 255, true) blockc = false else outputChatBox("#FFFF00* GM "..getPlayerName(source).."#00FF00 trancou o chat para demais usuários.", getRootElement(), 255, 255, 255, true) blockc = true end else return outputChatBox("#ffff00Access denied.", source, 255, 255, 255, true) end return 0 end addCommandHandler("chat", bbc) Link to comment
Castillo Posted June 22, 2013 Share Posted June 22, 2013 You must cancel the 'onPlayerChat' event when the chat is blocked. Link to comment
gustavorn Posted June 22, 2013 Author Share Posted June 22, 2013 (edited) DOWN @ Edited June 22, 2013 by Guest Link to comment
Castillo Posted June 22, 2013 Share Posted June 22, 2013 I don't understand what you said. Link to comment
gustavorn Posted June 22, 2013 Author Share Posted June 22, 2013 (edited) I don't understand what you said. function bbc(source) local accName = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then if blockc == true then outputChatBox("#FFFF00* GM "..getPlayerName(source).."#00FF00 normalizou o chat para demais usuários.", getRootElement(), 255, 255, 255, true) blockc = false else outputChatBox("#FFFF00* GM "..getPlayerName(source).."#00FF00 trancou o chat para demais usuários.", getRootElement(), 255, 255, 255, true) cancelEvent() blockc = true end else return outputChatBox("#ffff00Access denied.", source, 255, 255, 255, true) end return 0 end addCommandHandler("chat", bbc) Edited June 22, 2013 by Guest Link to comment
Castillo Posted June 22, 2013 Share Posted June 22, 2013 local blockc = false function bbc ( source ) local accName = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ( "user."..accName, aclGetGroup ( "Admin" ) ) then if ( blockc == true ) then outputChatBox ( "#FFFF00* GM ".. getPlayerName ( source ) .."#00FF00 normalizou o chat para demais usuários.", getRootElement(), 255, 255, 255, true ) blockc = false else outputChatBox ( "#FFFF00* GM ".. getPlayerName ( source ) .."#00FF00 trancou o chat para demais usuários.", getRootElement(), 255, 255, 255, true ) blockc = true end else outputChatBox ( "#ffff00Access denied.", source, 255, 255, 255, true ) end end addCommandHandler ( "chat", bbc ) addEventHandler ( "onPlayerChat", root, function ( ) if ( blockc ) then cancelEvent ( ) end end ) Link to comment
gustavorn Posted June 22, 2013 Author Share Posted June 22, 2013 (edited) Very thanks man, i love you. You saved my night; @Edit I rushed ops, users continue typing to chat. Edited June 22, 2013 by Guest Link to comment
gustavorn Posted June 22, 2013 Author Share Posted June 22, 2013 In the server no have resource , 'Freeroam'. I also think it would not have problems with the FR Link to comment
Castillo Posted June 22, 2013 Share Posted June 22, 2013 You must have a resource making his own chatbox outputs. Link to comment
gustavorn Posted June 22, 2013 Author Share Posted June 22, 2013 Truth is yes, Castillo I love you. 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