Fl!k
Wiek: 26 Na forum: 3592 dni Posty: 162
Piwa : 18
Witam , chcia?bym poprosi? o pomoc. Chcia?bym aby przez skrypt na czat da?o si? wpisywa? komendy "/" a nie przez konsole
server.lua
local badwords = {
"сука" ,
"Сука" ,
"сУка" ,
"суКа" ,
"СукА" ,
"сУкА" ,
"пизда" ,
"Пизда" ,
"Ебал" ,
"ебал" ,
"мамку" ,
"хуйло" ,
"Хуйло" ,
"Пидар" ,
"пидар" ,
"пидара" ,
"Пидара" ,
"нахуй" ,
"Нахуй" ,
"хуй" ,
"Хуй" ,
"ХуЙ"
}
function globalMessage ( thePlayer , cmd , ...)
local message = table . concat ( { ... }, " " )
local name = getPlayerName ( thePlayer )
if isPlayerMuted ( thePlayer ) then
outputChatBox ( "You are muted!" , thePlayer , 255 , 128 , 22 , true )
return
end
if pregFind ( message , "([0-9]{1,3})[^[:digit:]^[:cntrl:]]{1,3}([0-9]{1,3})[^[:digit:]^[:cntrl:]]{1,3}([0-9]{1,3})[^[:digit:]^[:cntrl:]]{1,3}([0-9]{1,3})" ) then
return
end
for i , w in ipairs ( badwords ) do
if pregFind ( message , w ) then
setPlayerMuted ( thePlayer , true )
local mutetime = 60000
local randomtime = math . random ( 1 , 3 )
if randomtime == 1 then mutetime = 60000 elseif randomtime == 2 then mutetime = 120000 elseif randomtime == 3 then mutetime = 180000 end
setTimer ( setPlayerMuted , mutetime , 1 , thePlayer , false )
setTimer ( outputChatBox , mutetime , 1 , "" , thePlayer , 0 , 255 , 43 , true )
outputChatBox ( "" .. randomtime .. " мин Причина: исп. не цензурных слов!" , thePlayer , 255 , 128 , 22 , true )
return
end
end
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "rcon" )) then
outputChatBox ( "#9900CC[BOSS] #ffffff" .. name .. ":#ffffff " .. message , getRootElement (), 60 , 200 , 40 , true )
elseif isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "Support" )) then
outputChatBox ( "#4060FF[ Support ]#ffffff" .. name .. ":#4060FF " .. message , getRootElement (), 60 , 200 , 40 , true )
elseif isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "debil" )) then
outputChatBox ( "#CC33CC[DEBIL] #ffffff" .. name .. ":#ffffff " .. message , getRootElement (), 60 , 200 , 40 , true )
elseif isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "Mapper" )) then
outputChatBox ( "#80C020[ Grafik ]#ffffff" .. name .. ":#FFFFFF " .. message , getRootElement (), 60 , 200 , 40 , true )
elseif isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "YouTuber" )) then
outputChatBox ( "#336600[ YouTuber ]#ffffff" .. name .. ":#FFFFFF " .. message , getRootElement (), 60 , 200 , 40 , true )
elseif isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "JAdmin" )) then
outputChatBox ( "#800000[ JAdmin ]#ffffff" .. name .. ":#800000 " .. message , getRootElement (), 60 , 200 , 40 , true )
elseif isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "Skrypter" )) then
outputChatBox ( "#00C0FF[Skrypter] #ffffff" .. name .. ":#ffffff " .. message , getRootElement (), 60 , 200 , 40 , true )
elseif isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "Moderator" )) then
outputChatBox ( "#00FF00[Moderator] #ffffff" .. name .. ":#ffffff " .. message , getRootElement (), 60 , 200 , 40 , true )
elseif isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "noname" )) then
outputChatBox ( "#ffffff[#000000noname#ffffff] #ffffff" .. name .. ":#000000 " .. message , getRootElement (), 60 , 200 , 40 , true )
elseif isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "SuperModerator" )) then
outputChatBox ( "#CCCC33[SuperModerator] #ffffff" .. name .. ":#ffffff " .. message , getRootElement (), 60 , 200 , 40 , true )
elseif isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "ModChat" )) then
outputChatBox ( "#339999[ModChat] #ffffff" .. name .. ":#ffffff " .. message , getRootElement (), 60 , 200 , 40 , true )
elseif isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "Champion" )) then
outputChatBox ( "#FFFF00[Champion] #ffffff" .. name .. ":#ffffff " .. message , getRootElement (), 60 , 200 , 40 , true )
elseif isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "paralityk" )) then
outputChatBox ( "#8A8A8A[Paralityk] #ffffff" .. name .. ":#ffffff " .. message , getRootElement (), 60 , 200 , 40 , true )
elseif isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "KING" )) then
outputChatBox ( "#E65100[KING] #ffffff" .. name .. ":#ffffff " .. message , getRootElement (), 60 , 200 , 40 , true )
elseif isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "spocony" )) then
outputChatBox ( "#97694F[Spoceniec] #ffffff" .. name .. ":#ffffff " .. message , getRootElement (), 60 , 200 , 40 , true )
elseif isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "Admin" )) then
outputChatBox ( "#800000[#800000Admin] #ffffff" .. name .. ":#ffffff " .. message , getRootElement (), 60 , 200 , 40 , true )
else
outputChatBox ( "#808080[Gracz] #ffffff" .. name .. ":#FFFFFF " .. message , getRootElement (), 255 , 255 , 255 , true )
end
outputServerLog ( "[#ff0033GOWNO]" .. getPlayerName ( thePlayer ).. ": " .. message )
end
addCommandHandler ( "GlobalChat" , globalMessage )
client.lua
bindKey ( "t" , "down" , "chatbox" , "GlobalChat" )