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

[TALKACTION] Mute on help channel

Nesaj

New Member
Joined
Apr 10, 2008
Messages
126
Reaction score
0
Is it possible to mute a player only on HELP channel with a talkaction?

Here's a basic mute script:

Code:
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)
			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
 
In channels.xml, specify a number for conditionId, like conditionId="4" and set same subID in your talkaction:

under:
Code:
setConditionParam(condition, CONDITION_PARAM_TICKS, time)
add:
Code:
setConditionParam(condition, CONDITION_PARAM_SUBID, 4)
 
Back
Top