السلام عليكم انا لساتني سيئ بالبرمجة بس عندي سؤال هاذا وش
chatTime = {}
lastChatMessage = {}
addEventHandler("onPlayerChat", getRootElement(),
function(text, msgtype)
local result = SQLS3D.qury("SELECT * FROM Tags_System")
if ( type ( result ) == "table" and #result == 0 or not result ) then return end
local account = getAccountName(getPlayerAccount(source))
local name = getPlayerName(source)
local new = ""
local iter = 0
msg = string.gsub(text,"ـ","")
for word in msg:gmatch("%S+") do
iter = iter + 1
for i,swr in ipairs(words) do
local src = word:lower():gsub("%s","")
local src = src:gsub("#%x%x%x%x%x%x","")
local src = src:gsub("%c","")
local src = src:gsub("%p","")
local pat = swr:lower():gsub("%s","")
if src:find(pat) then
local replaceString = ""
for x=1,word:gsub("#%x%x%x%x%x%x",""):len() do
replaceString = replaceString.."*"
end
word = word:gsub(word,replaceString)
end
end
if iter == 1 and word:len() > 2 then
word = word:gsub("%a",string.upper,1)
end
new = new..word.." "
end
if new ~= "" then msg = new end
text = msg
if chatTime[source] and chatTime[source] + tonumber(1000) > getTickCount() then
cancelEvent()
outputChatBox("Stop spamming main chat!", source, 255, 0, 0)
return
else
chatTime[source] = getTickCount()
end
if lastChatMessage[source] and lastChatMessage[source] == text then cancelEvent() return outputChatBox("Stop repeating yourself!", source, 255, 0, 0) end
lastChatMessage[source] = text
local r, g, b = getPlayerNametagColor(source)
cancelEvent()
for k, v in ipairs(Tag) do
if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup(v["tag"])) then
cancelEvent()
outputChatBox('#'..v["color1"]..' ' ..v["name"]..' '.. getPlayerName ( source ) .. ' : #'..v["color2"]..''..text..'', getRootElement(), r, g, b, true )
break
end
end
end
)
طبعا هاذا الكود جايبه من مود تاج لسعد