• 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!

Mute

Talkactions.xml
Code:
	<talkaction filter="word" log="no" access="3" words="!mute" script="mute.lua"/>

mute.lua
Lua:
--Adam 2008
--Goosio OT
--Original Credits

local condition = createConditionObject(CONDITION_MUTED)
setConditionParam(condition, CONDITION_PARAM_TICKS, 300*1000) -- 10*1000 is 10 seconds.

function onSay(cid, words, param)

player = getPlayerByName(param)
	if getPlayerGroupId(cid) > 2 then
		if player > 1 then
			doAddCondition(player, condition)
		else
			doPlayerSendCancel(cid, "That player is not online.")
		end
	else
		doPlayerSendCancel(cid, "You cannot execute this command.")
	end
end

Red: !mute "player - 5 minutes of mute.

Don't ever say I've done nothing for ya,
Red
 
Doesn't work.

Thanks for the info. Cause it works perfectly for me <_<

Common Problems:

Forgetting to reload!
/reload talkactions

Improper execution!
!mute "Red

Wrong Folder!
data/talkactions

Wrong OT version(?)
Tested in TFS 0.2.5 Mystic Spirit

Wrong LUA Name!
New LUA must be named 'mute.lua'

Wrong Access Level!
Code:
access="3"

Red
 
!mute "player - 5 ??
I thing it don't mute the player for 5 min.

@DedicatedOT: Try without any number: !mute "player, or !mute player.
 
Crazy Idea, probably will not work.

Lua:
local condition = createConditionObject(CONDITION_MUTED)
local minutes =
{
    ["1"] = {count = setConditionParam(condition, CONDITION_PARAM_TICKS, 1 * 60000)},
    ["3"] = {count = setConditionParam(condition, CONDITION_PARAM_TICKS, 3 * 60000)},
    ["5"] = {count = setConditionParam(condition, CONDITION_PARAM_TICKS, 5 * 60000)}
}

function onSay(cid, words, param)
local player = getPlayerByName(param)
    if getPlayerGroupId(cid) > 2 then
        if player == TRUE then
            doAddCondition(player, condition, minutes[param].count)
        else
            doPlayerSendCancel(cid, "That person is not online.")
        end
    else
        doPlayerSendCancel(cid, "You cannot execute this command.")
    end
    return TRUE
end
 
CLARIFICATION:

THESE ARE THE EXACT WORDS YOU SAY IN-GAME!

18:55 Red [1337]: !mute "Shawak

That will mute him for 5 minutes, as it is configured for 5 minutes in the LUA. Trying to be as blunt and clear as possible <_<

Red
 
Crazy Idea, probably will not work.

Lua:
local condition = createConditionObject(CONDITION_MUTED)
local minutes =
{
    ["1"] = {count = setConditionParam(condition, CONDITION_PARAM_TICKS, 1 * 60000)},
    ["3"] = {count = setConditionParam(condition, CONDITION_PARAM_TICKS, 3 * 60000)},
    ["5"] = {count = setConditionParam(condition, CONDITION_PARAM_TICKS, 5 * 60000)}
}

function onSay(cid, words, param)
local player = getPlayerByName(param)
    if getPlayerGroupId(cid) > 2 then
        if player == TRUE then
            doAddCondition(player, condition, minutes[param].count)
        else
            doPlayerSendCancel(cid, "That person is not online.")
        end
    else
        doPlayerSendCancel(cid, "You cannot execute this command.")
    end
    return TRUE
end



Worked. Thanks JDB! Rep ++
 
CLARIFICATION:

THESE ARE THE EXACT WORDS YOU SAY IN-GAME!

18:55 Red [1337]: !mute "Shawak

That will mute him for 5 minutes, as it is configured for 5 minutes in the LUA. Trying to be as blunt and clear as possible <_<

Red

You are only owning yourself, :thumbup:.
 
JDB I like your style of scripting :D anyway, nice script. But what do you need it for?
__________________
klekSu.png

You are welcome on kleksoria.com!
Please visit new open tibia forum with it's own ots list. otservers.net!
 
Last edited:
Back
Top