• 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 Easy Mute Command

xxgoosexx

GoosioOT
Joined
Jul 10, 2007
Messages
298
Reaction score
2
Code:
--Adam 2008
--Goosio OT

local condition = createConditionObject(CONDITION_MUTED)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10*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
 
Last edited:
Yea, talkaction.

talkactions.lua
Code:
	<talkaction filter="word" log="no" access="3" words="!mute" script="mute.lua"/>
 
I like the Idea but maybe implent more features:
-Tell the player that he got muted.
-Set the time as param
...

Yours
 
I like the Idea but maybe implent more features:
-Tell the player that he got muted.
-Set the time as param
...

Yours

i actually did all that in the update i did for my server, the time as a parameter is iffy tho cause you have to define the condition outside of the function in which the parameter is being used in so setting a time based on parameter isnt really working
 
I think you don't need getPlayerGroupId because you can work with access. Well it depends on how you like it, you can give it access and remove a line, doesn't matter much though.

Some not-criticism, nice script! :D
 
[09/03/2009 11:27:38] Lua Script Error: [TalkAction Interface]
[09/03/2009 11:27:38] data/talkactions/scripts/mute.lua:eek:nSay

[09/03/2009 11:27:38] data/talkactions/scripts/mute.lua:11: attempt to compare number with nil
[09/03/2009 11:27:38] stack traceback:
[09/03/2009 11:27:38] data/talkactions/scripts/mute.lua:11: in function <data/talkactions/scripts/mute.lua:7>
 
[09/03/2009 11:27:38] Lua Script Error: [TalkAction Interface]
[09/03/2009 11:27:38] data/talkactions/scripts/mute.lua:eek:nSay

[09/03/2009 11:27:38] data/talkactions/scripts/mute.lua:11: attempt to compare number with nil
[09/03/2009 11:27:38] stack traceback:
[09/03/2009 11:27:38] data/talkactions/scripts/mute.lua:11: in function <data/talkactions/scripts/mute.lua:7>

if line 11 for you is [if player > 1 then]

it may be that player is a nil value, if you are using 0.3 i have not tested this script yet, it works on 0.2 though
 
Back
Top