Disable chatting on RP server

Hey, i have a RP server, and i wonder if there is a script or setting so no one can use the chat. but admins can still use commands like /dv

Just create a server sided script that cancels all chat messages? Haven’t tested it but something like this might work:

AddEventHandler('chatMessage', function()
    CancelEvent()
end)