• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[REQUEST] Amazing Script!

Unconsciousness

Banned User
Joined
Jun 8, 2010
Messages
103
Reaction score
0
I am looking for a script, that does the following;
Each time a player says something with; zapto.org, no-ip.org, no-ip.info, it will say "Oh this server rox" or something like that, just simply to prevent advertising.
 
I could make this script but then again I've seen this script around, so I looked up the thread.

LUA:
local BlockedChannels = {
        {channel = CHANNEL_DEFAULT}, 
        {channel = CHANNEL_HELP, type = TALKTYPE_CHANNEL_Y}, 
        {channel = CHANNEL_GUILD, type = TALKTYPE_CHANNEL_Y}
}

local InvalidWords = {
        "whore",
        "slut",
        "fuck",
        "mother~fucker"
}

function onSay(cid, words, param, channel)
local TheWords = words .. param
        for i, select in ipairs(BlockedChannels) do
                if select.channel == channel then
                        talkType = select.type
                        break
                elseif select.channel ~= channel and i == #BlockedChannels then
                        return false
                end
        end

        for i = 1, #InvalidWords do
                TheWords = TheWords:gsub("(%a*".. nocase(InvalidWords[i]) .."%a*)", doFixString(InvalidWords[i]))
        end

        if channel == CHANNEL_DEFAULT then
                doCreatureSay(cid, TheWords, TALKTYPE_SAY)
        else
                doPlayerSendChannelMessage(cid, getCreatureName(cid), TheWords, talkType, channel)
        end
        return true
end

function doFixString(w) 
        return ("*"):rep(w:len())
end 

function nocase(s)
        -- From: [url=http://www.lua.org/pil/20.4.html]Programming in Lua : 20.4[/url]
        return s:gsub("%a", function(c) return ("[%s%s]"):format(c:lower(), c:upper()) end)
end

Credits go to Mazen for the script, I am just posting it here.
 
@up
Ye there was an anti advertising script somewhere.
Source edit needed (at least some kind of onCreatureSay)
 
Back
Top