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

Lua Script to mute X player on Y time on help channel

WaderoS

New Member
Joined
Nov 22, 2008
Messages
98
Reaction score
1
Hello.
I need one script.
I wanna to block/mute X player on Y time on help chat.
TFS 0.3.6
 
You can do it either via channels.xml, just look how its done with "Trade", or with this script (however it will mute player on all channels, because there is no such option to mute on specified channel yet)

Code:
function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end

	local t = string.explode(param, ",")
	local pid = getPlayerByNameWildcard(t[1])
	if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " is not currently online.")
		return true
	end

	if(getPlayerAccess(cid) <= getPlayerAccess(pid)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot perform action.")
		return true
	end

	local time = tonumber(t[2])
	if(not time or time <= 0) then
		time = -1
	end

	doMutePlayer(pid, time)
	return true
end
 
Ok i choose change HELP in channels.xml but i've got one question.

Code:
	<channel id="6" name="Trade" level="8" muted="120" conditionId="2" conditionMessage="You may only place one offer in two minutes.">
		<vocation id="1-8"/>
	</channel>
	<channel id="7" name="Trade-Rookgaard" level="2" muted="120" conditionId="3" conditionMessage="You may only place one offer in two minutes.">
		<vocation id="0"/>
	</channel>
Here we have 2x trade with this system.
Now if i wanna change HELP i must put it?:
Code:
	<channel id="9" name="Help" logged="yes" level="1" muted="120" conditionID="3" conditionMessage="You may only place one text in two minutes."/>
Is it good?
 
Back
Top