PAC3-Server / notagain

Custom Servercontent for the official PAC3 Server.
GNU General Public License v3.0
13 stars 22 forks source link

add dev helper file with Say function #71

Closed Myaats closed 7 years ago

CapsAdmin commented 7 years ago

this should be added to easylua

Zeni44 commented 7 years ago

Yeah. @CapsAdmin said that actually

Tenrys commented 7 years ago

high level of shitcode. This is ideal.

if CLIENT then
    function Say(str)
        RunConsoleCommand("say", str)
    end
elseif SERVER then
    function Say(...)
        local first = true
        local msg = ""
        for _, v in pairs({...}) do
            if first then
                first = false
            else
                msg = msg .. " "
            end
            msg = msg .. tostring(v)
        end
        msg = msg:gsub("\n", ""):gsub(";", ":"):gsub("\"", "'")
        game.ConsoleCommand("say " .. msg .. "\n")
    end
end
Earu commented 7 years ago

Maybe less argument if pr closed