Postado Outubro 6, 2017 7 anos @JcA Mil perdões, entendi errado, entendi que você queria que o player não atacasse pessoas de qualquer time haha, a modificação correta seria trocar o return false do onPrepareDeath para return true. O correto ficará assim: Spoiler --[[ <!-- DUCA Event --> <event type="login" name="Duca-Login" event="script" value="DUCA_creaturescript.lua"/> <event type="logout" name="Duca-Logout" event="script" value="DUCA_creaturescript.lua"/> <event type="preparedeath" name="Duca-Death" event="script" value="DUCA_creaturescript.lua"/> <event type="combat" name="Duca-Combat" event="script" value="DUCA_creaturescript.lua"/> ]]-- dofile('data/lib/DUCA.lua') function onLogin(cid) if getPlayerStorageValue(cid, DUCA.STORAGE_TEAM) > 0 then DUCA.removePlayer(cid) end return true end function onLogout(cid) if getPlayerStorageValue(cid, DUCA.STORAGE_TEAM) > 0 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not logout now!") return false end return true end function onPrepareDeath(cid, deathList, lastHitKiller, mostDamageKiller) local pontos = {[1] = 1, [2] = 1, [3] = 10, [4] = 30,} if getPlayerStorageValue(cid, DUCA.STORAGE_TEAM) > 0 then local pontos_ganhos = pontos[getPlayerStorageValue(cid, DUCA.STORAGE_TEAM)] setPlayerStorageValue(deathList[1], DUCA.TOTAL_PONTOS, getPlayerStorageValue(deathList[1], DUCA.TOTAL_PONTOS) + pontos_ganhos) doPlayerSendTextMessage(deathList[1], MESSAGE_STATUS_CONSOLE_BLUE, "You have ".. getPlayerStorageValue(deathList[1], DUCA.TOTAL_PONTOS) .." duca points.") DUCA.removePlayer(cid) DUCA.updateRank() end return true end function onCombat(cid, target) if isPlayer(cid) and isPlayer(target) then if getPlayerStorageValue(cid, DUCA.STORAGE_TEAM) > 0 then if getPlayerStorageValue(cid, DUCA.STORAGE_TEAM) == getPlayerStorageValue(target, DUCA.STORAGE_TEAM) then return false end end end return true end
Postado Outubro 6, 2017 7 anos Autor 19 minutos atrás, antharaz disse: @JcA Mil perdões, entendi errado, entendi que você queria que o player não atacasse pessoas de qualquer time haha, a modificação correta seria trocar o return false do onPrepareDeath para return true. O correto ficará assim: Mostrar conteúdo oculto --[[ <!-- DUCA Event --> <event type="login" name="Duca-Login" event="script" value="DUCA_creaturescript.lua"/> <event type="logout" name="Duca-Logout" event="script" value="DUCA_creaturescript.lua"/> <event type="preparedeath" name="Duca-Death" event="script" value="DUCA_creaturescript.lua"/> <event type="combat" name="Duca-Combat" event="script" value="DUCA_creaturescript.lua"/> ]]-- dofile('data/lib/DUCA.lua') function onLogin(cid) if getPlayerStorageValue(cid, DUCA.STORAGE_TEAM) > 0 then DUCA.removePlayer(cid) end return true end function onLogout(cid) if getPlayerStorageValue(cid, DUCA.STORAGE_TEAM) > 0 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not logout now!") return false end return true end function onPrepareDeath(cid, deathList, lastHitKiller, mostDamageKiller) local pontos = {[1] = 1, [2] = 1, [3] = 10, [4] = 30,} if getPlayerStorageValue(cid, DUCA.STORAGE_TEAM) > 0 then local pontos_ganhos = pontos[getPlayerStorageValue(cid, DUCA.STORAGE_TEAM)] setPlayerStorageValue(deathList[1], DUCA.TOTAL_PONTOS, getPlayerStorageValue(deathList[1], DUCA.TOTAL_PONTOS) + pontos_ganhos) doPlayerSendTextMessage(deathList[1], MESSAGE_STATUS_CONSOLE_BLUE, "You have ".. getPlayerStorageValue(deathList[1], DUCA.TOTAL_PONTOS) .." duca points.") DUCA.removePlayer(cid) DUCA.updateRank() end return true end function onCombat(cid, target) if isPlayer(cid) and isPlayer(target) then if getPlayerStorageValue(cid, DUCA.STORAGE_TEAM) > 0 then if getPlayerStorageValue(cid, DUCA.STORAGE_TEAM) == getPlayerStorageValue(target, DUCA.STORAGE_TEAM) then return false end end end return true end Não ataca ainda, só para tomar ciencia, o script não bloqueia para atacar entre mc né? Pelo menos não identifiquei nd, enfim, complicado
Postado Outubro 7, 2017 7 anos Só pode ser conflito entre storages. Defina novos valores de storages para o evento e teste ... E caso tenha problemas com este evento crie um "issue" no meu git: https://github.com/luanluciano93/ESTUDOS/tree/master/LUA/DUCA Editado Outubro 7, 2017 7 anos por luanluciano93 (veja o histórico de edições) STYLLER OT 2022
Postado Outubro 7, 2017 7 anos @JcA Acho que já nãoe ntendi mais nada do q vc qria asdhuiasdhuihuiasd, uma hora entendi que queria uma coisa, depois que você queria que morresse normal, agr qr q ataque >.< acho melhor o autor do sistema te ajudar msm porque não to sabendo o que você ta querendo. :X
Postado Outubro 7, 2017 7 anos Autor Solução 25 minutos atrás, antharaz disse: @JcA Acho que já nãoe ntendi mais nada do q vc qria asdhuiasdhuihuiasd, uma hora entendi que queria uma coisa, depois que você queria que morresse normal, agr qr q ataque >.< acho melhor o autor do sistema te ajudar msm porque não to sabendo o que você ta querendo. :X O problema é o seguinte. o evento em si funciona, o problema é que não da para matar ng dps q entra no evento, nada mais alem disso. Graças ao Anthraz, funcionou com isso aqui: --[[ <!-- DUCA Event --> <event type="login" name="Duca-Login" event="script" value="DUCA_creaturescript.lua"/> <event type="logout" name="Duca-Logout" event="script" value="DUCA_creaturescript.lua"/> <event type="preparedeath" name="Duca-Death" event="script" value="DUCA_creaturescript.lua"/> <event type="combat" name="Duca-Combat" event="script" value="DUCA_creaturescript.lua"/> ]]-- dofile('data/lib/DUCA.lua') function onLogin(cid) if tonumber(getPlayerStorageValue(cid, DUCA.STORAGE_TEAM)) > 0 then DUCA.removePlayer(cid) end return true end function onLogout(cid) if tonumber(getPlayerStorageValue(cid, DUCA.STORAGE_TEAM)) > 0 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not logout now!") return false end return true end function onPrepareDeath(cid, deathList, lastHitKiller, mostDamageKiller) local pontos = {[1] = 1, [2] = 1, [3] = 10, [4] = 30,} if tonumber(getPlayerStorageValue(cid, DUCA.STORAGE_TEAM)) > 0 then local pontos_ganhos = pontos[getPlayerStorageValue(cid, DUCA.STORAGE_TEAM)] setPlayerStorageValue(deathList[1], DUCA.TOTAL_PONTOS, getPlayerStorageValue(deathList[1], DUCA.TOTAL_PONTOS) + pontos_ganhos) doPlayerSendTextMessage(deathList[1], MESSAGE_STATUS_CONSOLE_BLUE, "You have ".. getPlayerStorageValue(deathList[1], DUCA.TOTAL_PONTOS) .." duca points.") DUCA.removePlayer(cid) DUCA.updateRank() end return false end function onCombat(cid, target) if isPlayer(cid) and isPlayer(target) then if tonumber(getPlayerStorageValue(cid, DUCA.STORAGE_TEAM)) > 0 then if tonumber(getPlayerStorageValue(cid, DUCA.STORAGE_TEAM)) == tonumber(getPlayerStorageValue(cid, DUCA.STORAGE_TEAM)) then return true end end end return true end Editado Outubro 7, 2017 7 anos por JcA (veja o histórico de edições)
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.