Client Side:
local Key = "F2" -- زر فتح اللوحة
---------------------------------------
screenW, screenH = guiGetScreenSize()
wnd = guiCreateWindow((screenW - 133) / 2, (screenH - 96) / 2, 133, 96, "[ Clear Chat ]", false)
guiSetVisible(wnd, false)
guiWindowSetSizable(wnd, false)
guiSetAlpha(wnd, 1.00)
guiSetProperty(wnd, "CaptionColour", "FF0089FE")
c = guiCreateButton(10, 43, 112, 31, "مسح الشات", false, wnd)
guiSetFont(c, "default-bold-small")
guiSetProperty(c, "NormalTextColour", "FFFD0000")
function Open ( )
guiSetVisible(wnd, not guiGetVisible(wnd))
showCursor(guiGetVisible(wnd))
end
bindKey(Key,"down", Open)
addEventHandler ( "onClientGUIClick", resourceRoot,
function ( )
if ( source == c ) then
triggerServerEvent("onClearChat", localPlayer)
end
end
)
---------------------------------------
Server Side:
ranks = {"Console","Admin"} -- الرتب الي يمديها تمسح الشات
---------------------------------------
addEvent("onClearChat",true)
addEventHandler("onClearChat",root,
function()
local accountName = getAccountName ( getPlayerAccount ( source ) )
for k,v in ipairs ( ranks ) do
if isObjectInACLGroup ("user."..accountName, aclGetGroup ( v ) ) then
for i = 0, 40 do
outputChatBox(" ",root,255,255,255)
end
outputChatBox("* Cleared The Chat By [#c10000"..getPlayerName(source).."#ffffff].",root,255,255,255,true)
end
end
end
)
---------------------------------------