Add a muted condition in the !jail talkaction script (at the top above function onSay).
Code:
local muted = createConditionObject(CONDITION_MUTED)
setConditionParam(muted, CONDITION_PARAM_TICKS, 10000000)
Then add the condition when the players gets teleported inside the jail.
Code:
doAddCondition(cid, muted)
Remove the condition when the players gets teleported outside the jail.
Code:
if getCreatureCondition(cid, CONDITION_MUTED) then
doRemoveCondition(cid, CONDITION_MUTED)
end