• 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 [Talkaction] Ignore Messages (/squelch)

Keram

Member
Joined
Jan 8, 2012
Messages
491
Reaction score
12
Location
DUBLIN
Hello,

could someone help me with making this script work so that:
if player with group id lower then x can't send a private message but if group id higher than x then a player can send a private message.

here is the script:
Code:
local ignore = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_IGNORE)
local teleport = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_TELEPORT)

function onSay(cid, words, param, channel)
	local condition = ignore
	local subId = GAMEMASTER_IGNORE
	local name = "private messages ignoring"
	if(words:sub(2, 2) == "c") then
		condition = teleport
		subId = GAMEMASTER_TELEPORT
		name = "map click teleport"
	end
	local action = "off"
	if(not getCreatureCondition(cid, CONDITION_GAMEMASTER, subId)) then
		doAddCondition(cid, condition)
		action = "on"
	else
		doRemoveCondition(cid, CONDITION_GAMEMASTER, subId)
	end
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have turned " .. action .. " " .. name .. ".")
	return true
end

thank you very much :)
 
Last edited:
Called /squelch

--same as urs I think just taken from le pc and it was working with meh, if it didnt work with u just gimme the error
Lua:
local ignore = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_IGNORE)
local teleport = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_TELEPORT)

function onSay(cid, words, param, channel)
	local condition = ignore
	local subId = GAMEMASTER_IGNORE
	local name = "private messages ignoring"
	if(words:sub(2, 2) == "c") then
		condition = teleport
		subId = GAMEMASTER_TELEPORT
		name = "map click teleport"
	end

	local action = "off"
	if(not getCreatureCondition(cid, CONDITION_GAMEMASTER, subId)) then
		doAddCondition(cid, condition)
		action = "on"
	else
		doRemoveCondition(cid, CONDITION_GAMEMASTER, subId)
	end

	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have turned " .. action .. " " .. name .. ".")
	return true
end

register @ Talkactions.xml:

XML:
<talkaction log="yes" words="/squelch" access="3" event="script" value="gamemaster.lua"/>
 
Last edited:
@up
That isn't what I wanted to do... I need help with remaking this script because I tried myself but I can't manage....

I want this:

If getPlayerGroupId < 4 then doPlayerSendMessage(cid, 22, "Sorry but admin is currently ignoring private messages")...

if If getPlayerGroupId > 3 then return true (??).... a player with group id > 3 is able to contact with the administrator even if he has ignoring private messages on...

Do you understand me now?
 
Lua:
local ignore = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_IGNORE)
local teleport = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_TELEPORT)

function onSay(cid, words, param, channel)
	local condition = ignore
	local subId = GAMEMASTER_IGNORE
	local name = "private messages ignoring"
	if(words:sub(2, 2) == "c") and 	getPlayerGroupId(cid) < 4 then
		condition = teleport
		subId = GAMEMASTER_TELEPORT
		name = "map click teleport"
	end

	local action = "off"
	if(not getCreatureCondition(cid, CONDITION_GAMEMASTER, subId)) then
		doAddCondition(cid, condition)
		action = "on"
	else
		doRemoveCondition(cid, CONDITION_GAMEMASTER, subId)
	end

	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have turned " .. action .. " " .. name .. ".")
	return true
end

@Down

Works now I think. I made it < 3 with a mistake.
 
Last edited:
@up
doesn't work :/

Senior tutor can still message god if he has turned on private message ignoring ;///

i dont want any1 below group id 4 to be able to message god if he has turned on pm ignoring...
 
try
Code:
local ignore = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_IGNORE)
local teleport = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_TELEPORT)
 
function onSay(cid, words, param, channel)
	local condition = ignore
	local subId = GAMEMASTER_IGNORE
	local name = "private messages ignoring"
	if(words:sub(2, 2) == "c") and 	getPlayerGroupId(cid) =< 4 then
		condition = teleport
		subId = GAMEMASTER_TELEPORT
		name = "map click teleport"
	end
 
	local action = "off"
	if(not getCreatureCondition(cid, CONDITION_GAMEMASTER, subId)) then
		doAddCondition(cid, condition)
		action = "on"
	else
		doRemoveCondition(cid, CONDITION_GAMEMASTER, subId)
	end
 
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have turned " .. action .. " " .. name .. ".")
	return true
end
 
@up would work but he said he tried it.

Lua:
local ignore = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_IGNORE)
local teleport = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_TELEPORT)
 
function onSay(cid, words, param, channel)
	local condition = ignore
	local subId = GAMEMASTER_IGNORE
	local name = "private messages ignoring"
	if(words:sub(2, 2) == "c") and 	getPlayerGroupId(cid) <= 5 then
		condition = teleport
		subId = GAMEMASTER_TELEPORT
		name = "map click teleport"
	end
 
	local action = "off"
	if(not getCreatureCondition(cid, CONDITION_GAMEMASTER, subId)) then
		doAddCondition(cid, condition)
		action = "on"
	else
		doRemoveCondition(cid, CONDITION_GAMEMASTER, subId)
	end
 
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have turned " .. action .. " " .. name .. ".")
	return true
end

@down, Okay, Edited.
 
Last edited:
@prondeliko
exactly, + with ur script i get an error
35chrhw.png



seriously, i am actually trying things i have never tried before... i didnt know i knew so much lua but i just cant put it all together into something ;///


i have tried adding different locals, then functions... never worked out... it seems like i knwo the codes but i just cant put them together into one working thing... ;/


EDIT @UP
still doesn't work... :/ tutors can't message to god but senior tutors can ;/ it seems like there is a function in sources that say that senior tutors are exception to this command.... the only way is to write a new script... ;/


EDIT 2: changing a number wont help... if it was that simple i would do it already but i know it wont work because i tried many stuff already :(
 
Last edited:
Back
Top