clearChatBox | Multi Theft Auto: Wiki Skip to content

clearChatBox

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function clears the chatbox. It does not clear the console (F8)

Syntax

clearChatBox ( )

Code Examples

server

This example adds an admin command to clear the chatbox for everyone

function cmdClearChat(p, cmd)
if not isPlayerStaff(p) then return end
clearChatBox()
end
addCommandHandler("clearchat", cmdClearChat)
-- Utility function
local staffACLs = {
aclGetGroup("Admin"),
aclGetGroup("Moderator")
}
function isPlayerStaff(p)
if isElement(p) and getElementType(p) == "player" and not isGuestAccount(getPlayerAccount(p)) then
local object = getAccountName(getPlayerAccount(p))
for _, group in ipairs(staffACLs) do
if isObjectInACLGroup("user." .. object, group) then
return true
end
end
end
return false
end