1. Sign up for news, events and more!

    You're currently visiting the official DarkRP Forums as a guest. Sign up now to participate in our community and we'll let you know when we have news.

Release Classic Advert

Discussion in 'DarkRP Addon & Plugin Releases' started by Fillipuster, Jun 23, 2016.

  1. Sir Klutch

    Sir Klutch Active Member

  2. UniquePumpkin

    UniquePumpkin New Member

    Oh my GOD ive been looking all over the internet and this one fucking works. Thank jesus. Thanks a lot man!!
     
  3. Fetty Awp

    Fetty Awp New Member

  4. Sir Klutch

    Sir Klutch Active Member

    lua/autorun
    Code (Lua):

    timer.Simple(2, function()
        if not DarkRP then
            return
        end

        local billboardfunction
        DarkRP.addPhrase('en', 'advert', '[Advert]')
        DarkRP.removeChatCommand("advert")

        local function PlayerAdvertise(ply, args)
            billboardfunction = DarkRP.getChatCommand("advert")
            billboardfunction = billboardfunction['callback']

            if args == "" then
                DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", ""))

                return ""
            end

            local DoSay = function(text)
                if text == "" then
                    DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", ""))

                    return
                end

                for k, v in pairs(player.GetAll()) do
                    local col = team.GetColor(ply:Team())
                    DarkRP.talkToPerson(v, col, DarkRP.getPhrase("advert") .. " " .. ply:Nick(), Color(255, 255, 0, 255), text, ply)
                end
            end

            return args, DoSay
        end

        DarkRP.declareChatCommand{
            command = "billboard",
            description = "Create a billboard holding an advertisement.",
            delay = 1.5
        }

        DarkRP.declareChatCommand{
            command = "advert",
            description = "Advertise something to everyone in the server.",
            delay = 1.5
        }

        if SERVER then
            DarkRP.defineChatCommand("advert", PlayerAdvertise, 1.5)
            DarkRP.defineChatCommand("billboard", billboardfunction)
        end
    end)
     
     

Share This Page