Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2021-02-03, 11:10


Fl!k







Wiek: 26
Na forum: 3592 dni
Posty: 162

Piwa: 18

Respekt: 50

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(thePlayercmd, ...)
    local message table.concat ( { ... }, " " )
    local name getPlayerName(thePlayer)
    if isPlayerMuted thePlayer then
        outputChatBox ("You are muted!"thePlayer25512822true)
        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 iw in ipairs(badwords) do
        if pregFind(messagewthen
            setPlayerMuted(thePlayertrue)
            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.." мин Причина: исп. не цензурных слов!"thePlayer25512822true)
        return
        end
    end
    if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("rcon")) then
        outputChatBox("#9900CC[BOSS] #ffffff" ..name.. ":#ffffff " .. messagegetRootElement(), 6020040true)
    elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Support")) then
        outputChatBox("#4060FF[ Support ]#ffffff" .. name .. ":#4060FF " .. messagegetRootElement(), 6020040true)
        elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("debil")) then
        outputChatBox("#CC33CC[DEBIL] #ffffff" .. name .. ":#ffffff " .. messagegetRootElement(), 6020040true)
    elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Mapper")) then
        outputChatBox("#80C020[ Grafik ]#ffffff" .. name .. ":#FFFFFF " .. messagegetRootElement(), 6020040true)
    elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("YouTuber")) then
        outputChatBox("#336600[ YouTuber ]#ffffff" .. name .. ":#FFFFFF " .. messagegetRootElement(), 6020040true)
    elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("JAdmin")) then
        outputChatBox("#800000[ JAdmin ]#ffffff" .. name .. ":#800000 " .. messagegetRootElement(), 6020040true)
    elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Skrypter")) then
        outputChatBox("#00C0FF[Skrypter] #ffffff" .. name .. ":#ffffff " .. messagegetRootElement(), 6020040true)
    elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Moderator")) then
        outputChatBox("#00FF00[Moderator] #ffffff" .. name .. ":#ffffff " .. messagegetRootElement(), 6020040true)
    elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("noname")) then
        outputChatBox("#ffffff[#000000noname#ffffff] #ffffff" .. name .. ":#000000 " .. messagegetRootElement(), 6020040true)
    elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("SuperModerator")) then
        outputChatBox("#CCCC33[SuperModerator] #ffffff" .. name .. ":#ffffff " .. messagegetRootElement(), 6020040true)
    elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("ModChat")) then
        outputChatBox("#339999[ModChat] #ffffff" .. name .. ":#ffffff " .. messagegetRootElement(), 6020040true)
elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Champion")) then
        outputChatBox("#FFFF00[Champion] #ffffff" .. name .. ":#ffffff " .. messagegetRootElement(), 6020040true)
elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("paralityk")) then
        outputChatBox("#8A8A8A[Paralityk] #ffffff" .. name .. ":#ffffff " .. messagegetRootElement(), 6020040true)
elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("KING")) then
        outputChatBox("#E65100[KING] #ffffff" .. name .. ":#ffffff " .. messagegetRootElement(), 6020040true)
    elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("spocony")) then
        outputChatBox("#97694F[Spoceniec] #ffffff" .. name .. ":#ffffff " .. messagegetRootElement(), 6020040true)
    elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) then
        outputChatBox("#800000[#800000Admin] #ffffff".. name .. ":#ffffff "  .. messagegetRootElement(), 6020040true)
    else
        outputChatBox("#808080[Gracz] #ffffff" ..name.. ":#FFFFFF " ..messagegetRootElement(), 255255255true)
    end
    outputServerLog("[#ff0033GOWNO]"..getPlayerName(thePlayer)..": "..message)
end
addCommandHandler("GlobalChat"globalMessage)


client.lua
bindKey("t""down""chatbox""GlobalChat")


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-02-03, 11:37


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Sprawdzaj za pomoc? funkcji "string.sub" czy pierwszy znak do uko?nik.

http://www.lua.org/manual...#pdf-string.sub

Postaw piwo autorowi tego posta
 

 
Tagi: chat
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Chat Odpowiedz do tematu

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku