function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, 21, "explaining the talkaction")
return true
end
local t = string.explode(param, ",")
player = getPlayerByName(t[1])
local condition = createConditionObject(CONDITION_MUTED)
if(not t[2] or t[2] == '') then
doPlayerSendTextMessage(cid, 21, "explaining the talkaction")
end
if t[2] then
time = tonumber(t[2]*1000) -- 10*1000 is 10 seconds.
if(isPlayer(player) == TRUE and getPlayerGroupId(cid) > getPlayerGroupId(player) and getPlayerFlagValue(player, PLAYERFLAG_CANNOTBEMUTED) == false) then
setConditionParam(condition, CONDITION_PARAM_TICKS, time)
setConditionParam(condition, CONDITION_PARAM_SUBID, 4)
doAddCondition(player, condition)
doPlayerSendTextMessage(player, MESSAGE_STATUS_WARNING, "You have been muted by " .. getPlayerName(cid) .. " for " .. t[2] .. " seconds.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(player) .. " has been muted for " .. t[2] .. " seconds.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " is not currently online or cannot be muted.")
end
end
return true
end