Bcload Posted February 2, 2019 Share Posted February 2, 2019 i've made script to disable the main chat but i'm tired to fix it i was trying many times to fix it, anyone know where is the problem? Spoiler local chat = true function chatDis(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then outputChatBox("#ff0000Main chat has been disabled by "..getPlayerName(thePlayer)..".",root,255, 255, 255, true) chat = false end end addCommandHandler("chatoff", chatDis) function chatEn(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then outputChatBox("#ff0000Main chat has been enabled by "..getPlayerName(thePlayer)..".",root,255, 255, 255, true) chat = true end end addCommandHandler("chaton", chatEn) function onChat ( _, messageType ) if ( messageType == 0 and not chat ) then cancelEvent ( ) end end addEventHandler ( "onPlayerChat", root, onChat ) Link to comment
AncienT Posted February 2, 2019 Share Posted February 2, 2019 function onChat ( _, messageType ) if ( messageType == 0 and chat == false ) then cancelEvent ( ) end end addEventHandler ( "onPlayerChat", root, onChat ) Link to comment
AncienT Posted February 2, 2019 Share Posted February 2, 2019 5 minutes ago, Bcload said: This function is for serverside 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