Postado Dezembro 25, 2014 10 anos Em 25/12/2014 em 00:03, Morfeusinho disse: apareceu o seguinte erro Lua Script Error: [TalkAction Interface] data/talkactions/scripts/broadcast.lua:onSay data/talkactions/scripts/broadcast.lua:6: attempt to call field 'explode' (a nil value) stack traceback: [C]: in function 'explode' data/talkactions/scripts/broadcast.lua:6: in function Adicione à lib do seu servidor: string.explode = function (str, sep, limit) if(type(sep) ~= 'string' or isInArray({tostring(str):len(), sep:len()}, 0)) then return {} end local i, pos, tmp, t = 0, 1, "", {} for s, e in function() return string.find(str, sep, pos) end do tmp = str:sub(pos, s - 1):trim() table.insert(t, tmp) pos = e + 1 i = i + 1 if(limit ~= nil and i == limit) then break end end tmp = str:sub(pos):trim() table.insert(t, tmp) return t end Em 25/12/2014 em 00:03, Morfeusinho disse: tem isso para a minha versão do tfs e do tibia? pois pelo que me falaram nesta nova versão só é suportada 3 groups Se não me engano, no TFS 1.0 são 4 groups com 3 "módulos de acesso". Seriam eles Player (none/0), Tutor (1), Senior Tutor (2) e God (3). Você pode aplicar as flags/custom flags como te indiquei anteriormente, aos groups de Tutor (2) e Senior Tutor (3), pelo seu groups.xml. The corrupt fear us. The honest support us. The heroic join us.
Postado Dezembro 25, 2014 10 anos da mensagem em vermelho, tente esse: function onSay(cid, words, param) if not getPlayerFlagValue(cid, PlayerFlag_CanBroadcast) then return true end local player = Player(cid) print("> broadcasted: \"" .. param .. "\".") for _, pid in ipairs(Game.getPlayers()) do pid:sendTextMessage(MESSAGE_STATUS_WARNING, param) end return false end editt O comando de mutar, vc quer em todos os canais ou so no help? Editado Dezembro 25, 2014 10 anos por narazaky (veja o histórico de edições) Te ajudei? Então Rep +
Postado Dezembro 26, 2014 10 anos Autor Em 25/12/2014 em 12:12, Suicide disse: Adicione à lib do seu servidor: string.explode = function (str, sep, limit) if(type(sep) ~= 'string' or isInArray({tostring(str):len(), sep:len()}, 0)) then return {} end local i, pos, tmp, t = 0, 1, "", {} for s, e in function() return string.find(str, sep, pos) end do tmp = str:sub(pos, s - 1):trim() table.insert(t, tmp) pos = e + 1 i = i + 1 if(limit ~= nil and i == limit) then break end end tmp = str:sub(pos):trim() table.insert(t, tmp) return tend Se não me engano, no TFS 1.0 são 4 groups com 3 "módulos de acesso". Seriam eles Player (none/0), Tutor (1), Senior Tutor (2) e God (3). Você pode aplicar as flags/custom flags como te indiquei anteriormente, aos groups de Tutor (2) e Senior Tutor (3), pelo seu groups.xml. é em customfunctions.lua? Olhe meu Groups.xml <?xml version="1.0" encoding="UTF-8"?><groups> <group id="1" name="Player" flags="0" access="0" maxdepotitems="0" maxvipentries="0" /> <group id="2" name="Tutor" flags="137438953471" access="0" maxdepotitems="0" maxvipentries="200" /> <group id="3" name="Admin" flags="272730398714" access="1" maxdepotitems="0" maxvipentries="200" /></groups> Em 25/12/2014 em 18:31, narazaky disse: da mensagem em vermelho, tente esse: function onSay(cid, words, param) if not getPlayerFlagValue(cid, PlayerFlag_CanBroadcast) then return true end local player = Player(cid) print("> broadcasted: \"" .. param .. "\".") for _, pid in ipairs(Game.getPlayers()) do pid:sendTextMessage(MESSAGE_STATUS_WARNING, param) end return falseend editt O comando de mutar, vc quer em todos os canais ou so no help? esse script que vc me enviou não pegou tb.. eu quero mute no help. Editado Dezembro 26, 2014 10 anos por Morfeusinho (veja o histórico de edições)
Postado Dezembro 26, 2014 10 anos Em 26/12/2014 em 15:12, Morfeusinho disse: é em customfunctions.lua? Olhe meu Groups.xml Não. Olha, calculei alguns valores, veja se te agrada: <?xml version="1.0" encoding="UTF-8"?> <groups> <group id="1" name="Player" flags="0" access="0" maxdepotitems="0" maxvipentries="0" /> <group id="2" name="Tutor" flags="137455730688" access="0" maxdepotitems="0" maxvipentries="200" /> <group id="3" name="Admin" flags="272730398714" access="1" maxdepotitems="0" maxvipentries="200" /> </groups> Editado Dezembro 28, 2014 10 anos por Suicide (veja o histórico de edições) The corrupt fear us. The honest support us. The heroic join us.
Postado Dezembro 26, 2014 10 anos qual erro deu? vai em talk action/script e crie um arquivo muted.lua e add isso: local CHANNEL_HELP = 7 local muted = createConditionObject(CONDITION_CHANNELMUTEDTICKS) local tempo = 300000 setConditionParam(muted, CONDITION_PARAM_SUBID, CHANNEL_HELP) setConditionParam(muted, CONDITION_PARAM_TICKS, tempo) function onSay(cid, words, param, channel) if words == "/mute" then local t = string.explode(string.lower(param), ",") local player = Player(cid) if not player:getGroup():getAccess() then return true end if (param == nil) or (param == '') or (not param) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,"Enter the name of the player") return true end if (Player(t[1])) then if(getCreatureCondition(Player(t[1]), CONDITION_CHANNELMUTEDTICKS, CHANNEL_HELP)) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,"The player "..getPlayerName (t [1]) .." is already mutated.") return true end doAddCondition(Player(t[1]), muted) Player(t[1]):sendTextMessage(MESSAGE_STATUS_DEFAULT,"You have been muted by the "..getPlayerName (cid) .." with "..tempo / 1000 .." seconds.") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,"The player "..getPlayerName (t [1]) .." has been mutated by "..tempo / 1000 .." seconds.") return true elseif (not Player(t[1])) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,"A player with that name is not online.") return true end end if words == "/unmute" then local t = string.explode(string.lower(param), ",") local player = Player(cid) if not player:getGroup():getAccess() then return true end if (param == nil) or (param == '') or (not param) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,"Enter the name of the player") return true end if (Player(t[1])) then if(getCreatureCondition(Player(t[1]), CONDITION_CHANNELMUTEDTICKS, CHANNEL_HELP)) then doRemoveCondition(Player(t[1]), CONDITION_CHANNELMUTEDTICKS, CHANNEL_HELP) Player(t[1]):sendTextMessage(MESSAGE_STATUS_DEFAULT,"You have been desmuted by the "..getPlayerName (cid) ..".") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,"The player "..getPlayerName(t[1]).." has been desmutated.") return true else player:sendCancelMessage("The player "..getPlayerName(t[1]).." is not muted") return true end else Player(cid):sendCancelMessage("A player with that name is not online.") return true end end end depois no talkaction.xml add isso: <talkaction words="/mute" separator=" " script="muted.lua" /> <talkaction words="/unmute" separator=" " script="muted.lua" /> Editado Dezembro 28, 2014 10 anos por narazaky (veja o histórico de edições) Te ajudei? Então Rep +
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.