FlamesAdmin 262 Postado Dezembro 1, 2013 Share Postado Dezembro 1, 2013 (editado) Alguem podia editar esse comando de Quizz pra mim: Script: function onSay(cid, words, param) if words == "!quiz" then if getPlayerGroupId(cid) <= 5 then return false end local t = string.explode(param, ",") if not t[1] or not t[2] or not getItemNameById(tonumber(t[3])) or not tonumber(t[4]) or #t < 4 then return doPlayerSendTextMessage(cid, 27, "Parametros incorreto, verifique o id do item e a quantidade : !quiz pergunta,resposta,premio,quantidade") end if getGlobalStorageValue(8745) == "evento" then doPlayerSendTextMessage(cid, 27, "Uma pergunta ja esta em andamento, espere alguem acertar.") end doBroadcastMessage("EVENTO QUIZ: " .. t[1] .. "\nVALENDO: " .. tonumber(t[4]) .. "x " .. getItemNameById(tonumber(t[3])) .. "\nUtilize o comando !respquiz para responder.") setGlobalStorageValue(8743, t[1]) setGlobalStorageValue(8744, t[2]) setGlobalStorageValue(8745, "evento") setGlobalStorageValue(8746, tonumber(t[3])) setGlobalStorageValue(8747, tonumber(t[4])) elseif words == "!respquiz" then if not param then doPlayerSendTextMessage(cid, 27, "Parametros não encontrado: !respquiz resposta") end if getGlobalStorageValue(8745) ~= "evento" then return doPlayerSendTextMessage(cid, 27, "Neste momento não existe nenhuma pergunta.") end local resposta = getGlobalStorageValue(8744) if not tonumber(resposta) then setGlobalStorageValue(8744, resposta:lower()) else setGlobalStorageValue(8744, tonumber(resposta)) end if not tonumber(param) then param = param:lower() else param = tonumber(param) end if param == resposta then doBroadcastMessage("PERGUNTA: " .. getGlobalStorageValue(8743) .. "\nRESPOSTA: " .. getGlobalStorageValue(8744) .. "\nVENCEDOR: " .. getCreatureName(cid) .. "\nPREMIO: " .. getGlobalStorageValue(8747) .. "x " .. getItemNameById(getGlobalStorageValue(8746))) doPlayerSendTextMessage(cid, 27, "Parabéns você acertou a pergunta, aqui esta seu premio!") doPlayerAddItem(cid, getGlobalStorageValue(8746), getGlobalStorageValue(8747)) for _, players in pairs(getPlayersOnline()) do if getPlayerGroupId(cid) > 5 then doPlayerSendTextMessage(player, 27, "O Player:" .. getCreatureName(cid) .. " acertou a pergunta.") end end setGlobalStorageValue(8745, 0) else doPlayerSendTextMessage(cid, 27, "Resposta errada!") end end return trueend Gostaria que colocasse pra Tutor ( Group 3 ) e GOD ( Group 5 ) poder usar o comando. Rep+ Creditos ao " xotservx " Editado Dezembro 1, 2013 por FlamesAdmin Link para o comentário https://xtibia.com/forum/topic/224797-encerrado-editar-comando-de-quizz/ Compartilhar em outros sites More sharing options...
Soulviling 66 Postado Dezembro 1, 2013 Share Postado Dezembro 1, 2013 se for pelo talkaction, me envia a tag. Link para o comentário https://xtibia.com/forum/topic/224797-encerrado-editar-comando-de-quizz/#findComment-1587731 Compartilhar em outros sites More sharing options...
FlamesAdmin 262 Postado Dezembro 1, 2013 Autor Share Postado Dezembro 1, 2013 se for pelo talkaction, me envia a tag. Ta ai: <talkaction words="!quiz;!respquiz" script="quiz.lua" /> Link para o comentário https://xtibia.com/forum/topic/224797-encerrado-editar-comando-de-quizz/#findComment-1587738 Compartilhar em outros sites More sharing options...
Soulviling 66 Postado Dezembro 1, 2013 Share Postado Dezembro 1, 2013 <talkaction words="!quiz;!respquiz" access="3" script="quiz.lua" /> vê ai Link para o comentário https://xtibia.com/forum/topic/224797-encerrado-editar-comando-de-quizz/#findComment-1587739 Compartilhar em outros sites More sharing options...
FlamesAdmin 262 Postado Dezembro 1, 2013 Autor Share Postado Dezembro 1, 2013 <talkaction words="!quiz;!respquiz" access="3" script="quiz.lua" /> vê ai Nao deu. Link para o comentário https://xtibia.com/forum/topic/224797-encerrado-editar-comando-de-quizz/#findComment-1587954 Compartilhar em outros sites More sharing options...
Soulviling 66 Postado Dezembro 1, 2013 Share Postado Dezembro 1, 2013 qual erro? Tentou com a conta de player normal? Link para o comentário https://xtibia.com/forum/topic/224797-encerrado-editar-comando-de-quizz/#findComment-1587955 Compartilhar em outros sites More sharing options...
FlamesAdmin 262 Postado Dezembro 1, 2013 Autor Share Postado Dezembro 1, 2013 Sim, nao funcionou. Nao da erro nenhum, simplesmente o ele fala normalmente o comando Link para o comentário https://xtibia.com/forum/topic/224797-encerrado-editar-comando-de-quizz/#findComment-1587961 Compartilhar em outros sites More sharing options...
zipter98 1102 Postado Dezembro 1, 2013 Share Postado Dezembro 1, 2013 (editado) Resumindo: você quer apenas que pessoas do group id 3 em diante, possam realizar o comando? Ou que apenas tutores e GODs possam? E qual dos comandos? !quiz ou !respquiz? Editado Dezembro 1, 2013 por zipter98 Link para o comentário https://xtibia.com/forum/topic/224797-encerrado-editar-comando-de-quizz/#findComment-1587963 Compartilhar em outros sites More sharing options...
FlamesAdmin 262 Postado Dezembro 1, 2013 Autor Share Postado Dezembro 1, 2013 Resumindo: você quer apenas que pessoas do group id 3 em diante, possam realizar o comando? Ou que apenas tutores e GODs possam? E qual dos comandos? !quiz ou !respquiz? Apenas Tutor (3) e ADM (6) podem executar o comando !quiz, e os players respondam com !respquiz Link para o comentário https://xtibia.com/forum/topic/224797-encerrado-editar-comando-de-quizz/#findComment-1587965 Compartilhar em outros sites More sharing options...
zipter98 1102 Postado Dezembro 1, 2013 Share Postado Dezembro 1, 2013 Tenta assim: function onSay(cid, words, param) if words == "!quiz" then if getPlayerGroupId(cid) <= 2 or (getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 5) then return doPlayerSendCancel(cid, "Só tutores e GODs podem usar esse comando!") end local t = string.explode(param, ",") if not t[1] or not t[2] or not getItemNameById(tonumber(t[3])) or not tonumber(t[4]) or #t < 4 then return doPlayerSendTextMessage(cid, 27, "Parametros incorreto, verifique o id do item e a quantidade : !quiz pergunta,resposta,premio,quantidade") end if getGlobalStorageValue(8745) == "evento" then doPlayerSendTextMessage(cid, 27, "Uma pergunta ja esta em andamento, espere alguem acertar.") end doBroadcastMessage("EVENTO QUIZ: " .. t[1] .. "\nVALENDO: " .. tonumber(t[4]) .. "x " .. getItemNameById(tonumber(t[3])) .. "\nUtilize o comando !respquiz para responder.") setGlobalStorageValue(8743, t[1]) setGlobalStorageValue(8744, t[2]) setGlobalStorageValue(8745, "evento") setGlobalStorageValue(8746, tonumber(t[3])) setGlobalStorageValue(8747, tonumber(t[4])) elseif words == "!respquiz" then if not param then doPlayerSendTextMessage(cid, 27, "Parametros não encontrado: !respquiz resposta") end if getGlobalStorageValue(8745) ~= "evento" then return doPlayerSendTextMessage(cid, 27, "Neste momento não existe nenhuma pergunta.") end local resposta = getGlobalStorageValue(8744) if not tonumber(resposta) then setGlobalStorageValue(8744, resposta:lower()) else setGlobalStorageValue(8744, tonumber(resposta)) end if not tonumber(param) then param = param:lower() else param = tonumber(param) end if param == resposta then doBroadcastMessage("PERGUNTA: " .. getGlobalStorageValue(8743) .. "\nRESPOSTA: " .. getGlobalStorageValue(8744) .. "\nVENCEDOR: " .. getCreatureName(cid) .. "\nPREMIO: " .. getGlobalStorageValue(8747) .. "x " .. getItemNameById(getGlobalStorageValue(8746))) doPlayerSendTextMessage(cid, 27, "Parabéns você acertou a pergunta, aqui esta seu premio!") doPlayerAddItem(cid, getGlobalStorageValue(8746), getGlobalStorageValue(8747)) for _, players in pairs(getPlayersOnline()) do if getPlayerGroupId(cid) > 5 then doPlayerSendTextMessage(player, 27, "O Player:" .. getCreatureName(cid) .. " acertou a pergunta.") end end setGlobalStorageValue(8745, 0) else doPlayerSendTextMessage(cid, 27, "Resposta errada!") end end return true end Link para o comentário https://xtibia.com/forum/topic/224797-encerrado-editar-comando-de-quizz/#findComment-1587970 Compartilhar em outros sites More sharing options...
FlamesAdmin 262 Postado Dezembro 1, 2013 Autor Share Postado Dezembro 1, 2013 Tenta assim: function onSay(cid, words, param) if words == "!quiz" then if getPlayerGroupId(cid) <= 2 or (getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 5) then return doPlayerSendCancel(cid, "Só tutores e GODs podem usar esse comando!") end local t = string.explode(param, ",") if not t[1] or not t[2] or not getItemNameById(tonumber(t[3])) or not tonumber(t[4]) or #t < 4 then return doPlayerSendTextMessage(cid, 27, "Parametros incorreto, verifique o id do item e a quantidade : !quiz pergunta,resposta,premio,quantidade") end if getGlobalStorageValue(8745) == "evento" then doPlayerSendTextMessage(cid, 27, "Uma pergunta ja esta em andamento, espere alguem acertar.") end doBroadcastMessage("EVENTO QUIZ: " .. t[1] .. "\nVALENDO: " .. tonumber(t[4]) .. "x " .. getItemNameById(tonumber(t[3])) .. "\nUtilize o comando !respquiz para responder.") setGlobalStorageValue(8743, t[1]) setGlobalStorageValue(8744, t[2]) setGlobalStorageValue(8745, "evento") setGlobalStorageValue(8746, tonumber(t[3])) setGlobalStorageValue(8747, tonumber(t[4])) elseif words == "!respquiz" then if not param then doPlayerSendTextMessage(cid, 27, "Parametros não encontrado: !respquiz resposta") end if getGlobalStorageValue(8745) ~= "evento" then return doPlayerSendTextMessage(cid, 27, "Neste momento não existe nenhuma pergunta.") end local resposta = getGlobalStorageValue(8744) if not tonumber(resposta) then setGlobalStorageValue(8744, resposta:lower()) else setGlobalStorageValue(8744, tonumber(resposta)) end if not tonumber(param) then param = param:lower() else param = tonumber(param) end if param == resposta then doBroadcastMessage("PERGUNTA: " .. getGlobalStorageValue(8743) .. "\nRESPOSTA: " .. getGlobalStorageValue(8744) .. "\nVENCEDOR: " .. getCreatureName(cid) .. "\nPREMIO: " .. getGlobalStorageValue(8747) .. "x " .. getItemNameById(getGlobalStorageValue(8746))) doPlayerSendTextMessage(cid, 27, "Parabéns você acertou a pergunta, aqui esta seu premio!") doPlayerAddItem(cid, getGlobalStorageValue(8746), getGlobalStorageValue(8747)) for _, players in pairs(getPlayersOnline()) do if getPlayerGroupId(cid) > 5 then doPlayerSendTextMessage(player, 27, "O Player:" .. getCreatureName(cid) .. " acertou a pergunta.") end end setGlobalStorageValue(8745, 0) else doPlayerSendTextMessage(cid, 27, "Resposta errada!") end end return true end Player normal ta dando pra usar o comando. Nao tem que mudar essa parte aqui em baixo ? for _, players in pairs(getPlayersOnline()) do if getPlayerGroupId(cid) > 5 then Link para o comentário https://xtibia.com/forum/topic/224797-encerrado-editar-comando-de-quizz/#findComment-1587977 Compartilhar em outros sites More sharing options...
zipter98 1102 Postado Dezembro 1, 2013 Share Postado Dezembro 1, 2013 (editado) Lol, que estranho Vou testar essa talkaction aqui, logo edito meu comentário. EDIT: Aqui funcionou perfeitamente, só tutores e GODs podendo usar o comando. Talvez você tenha adicionado alguma parte desse script erroneamente, ou, em seu servidor, não há determinada função usada nessa talkaction. Editado Dezembro 1, 2013 por zipter98 Link para o comentário https://xtibia.com/forum/topic/224797-encerrado-editar-comando-de-quizz/#findComment-1587990 Compartilhar em outros sites More sharing options...
FlamesAdmin 262 Postado Dezembro 1, 2013 Autor Share Postado Dezembro 1, 2013 (editado) Lol, que estranho Vou testar essa talkaction aqui, logo edito meu comentário. Ok. ---EDIT-- Affs que Fail, o outro player que eu tava testando era Tutor tbm pqp, desculpa erro meu. Editado Dezembro 1, 2013 por FlamesAdmin Link para o comentário https://xtibia.com/forum/topic/224797-encerrado-editar-comando-de-quizz/#findComment-1587991 Compartilhar em outros sites More sharing options...
zipter98 1102 Postado Dezembro 1, 2013 Share Postado Dezembro 1, 2013 (editado) edit: uhahuauhshuahus, de boa. De resto, o script está funcionando como você queria? Editado Dezembro 1, 2013 por zipter98 Link para o comentário https://xtibia.com/forum/topic/224797-encerrado-editar-comando-de-quizz/#findComment-1587997 Compartilhar em outros sites More sharing options...
FlamesAdmin 262 Postado Dezembro 1, 2013 Autor Share Postado Dezembro 1, 2013 Eu testei com essa tag: <talkaction words="!quiz;!respquiz" event="script" value="quiz.lua"/> A verificação do group id do jogador, já é feito no próprio script. Só não entendi o porque de não ter funcionado com você. Funcionou aqui, tava testanto com players tutores, tinha eskecido que o outro player na acc era tutor tbm, vlw ai pela ajuda man. Ja dei rep+ pra tu. edit: uhahuauhshuahus, de boa. De resto, o script está funcionando como você queria? Ta sim vlw. Link para o comentário https://xtibia.com/forum/topic/224797-encerrado-editar-comando-de-quizz/#findComment-1587998 Compartilhar em outros sites More sharing options...
Posts Recomendados