Postado Junho 19, 2015 10 anos Seguinte, estava adicionando um sistema de duelos no servidor pda 2015, porém estou com o seguinte problema: O duel se inicia de boa pá, porém não pode dar target por causa da seguinte script: local fightcondition = createConditionObject(CONDITION_INFIGHT) setConditionParam(fightcondition, CONDITION_PARAM_TICKS, 12 * 1000) function fightCondic(cid) if not isCreature(cid) then return true end if not isCreature(getCreatureTarget(cid)) then return true end doAddCondition(cid, fightcondition) addEvent(fightCondic, 1000, cid) end function onTarget(cid, target) if isPlayer(target) then if canAttackOther(cid, target) == "Can" then --edited PVP system return false elseif isPlayer(target) and #getCreatureSummons(target) >= 1 and canAttackOther(cid, target) == "Can" then return false end end if getPlayerStorageValue(target, 201) ~= -1 then for a, b in pairs(ginasios) do if getPlayerStorageValue(target, ginasios[getPlayerStorageValue(target, 201)].storage) == 1 then if getPlayerStorageValue(cid, ginasios[getPlayerStorageValue(target, 201)].storage) ~= 1 then doPlayerSendCancel(cid, "You can't attack this pokemon.") return false end end end end if isSummon(target) then --edited PVP system if canAttackOther(cid, target) == "Can" then return false end end if false then -- desativado if not isPlayerInAgressiveList(target, cid) then addPlayerToAgressiveList(target, cid) end if isPassive(target) then setAgressive(target) if #getCreatureSummons(cid) >= 1 then doMonsterSetTarget(target, getCreatureSummons(cid)[1]) else doMonsterSetTarget(target, cid) end else local histarget = getCreatureTarget(target) if isCreature(histarget) and isPlayer(getCreatureMaster(histarget)) and #getCreatureSummons(cid) >= 1 and #getCreatureSummons(getCreatureMaster(histarget)) <= 0 then doMonsterSetTarget(target, getCreatureSummons(cid)[1]) end end end return TRUE end Gostaria de saber se alguém poderia adicionar uma tag que checa a storage X de um player e a storage X do outro se um tiver valor x e outro valor y retorne can, obrigado desde já!
Postado Junho 19, 2015 10 anos O Sistema de (Duelo/PVP Team/PVP Normal) é tudo feito aqui , data/lib/somefunctions.lua: function canAttackOther(cid, pid) --Function q verifica se um poke/player pode atacar outro poke/player if not isCreature(cid) or not isCreature(pid) then return "Cant" end local master1 = isSummon(cid) and getCreatureMaster(cid) or cid local master2 = isSummon(pid) and getCreatureMaster(pid) or pid if getPlayerStorageValue(master1, 6598754) >= 1 and getPlayerStorageValue(master2, 6598755) >= 1 then return "Can" end if getPlayerStorageValue(master1, 6598755) >= 1 and getPlayerStorageValue(master2, 6598754) >= 1 then ---estar em times diferentes return "Can" end ---- if getTileInfo(getThingPos(cid)).pvp then return "Can" end if ehMonstro(cid) and ehMonstro(pid) and not isSummon(cid) and not isSummon(pid) then --alterado v2.9.1 return "Can" end return "Cant" end - é so Fazer o mesmo esquema dessas storages que tem dentro dessa Funçao que eu postei (Copiar e Colar e alterar nomes e valores) Editado Junho 19, 2015 10 anos por Nextbr (veja o histórico de edições)
Postado Junho 20, 2015 10 anos Autor O Sistema de (Duelo/PVP Team/PVP Normal) é tudo feito aqui , data/lib/somefunctions.lua: function canAttackOther(cid, pid) --Function q verifica se um poke/player pode atacar outro poke/player if not isCreature(cid) or not isCreature(pid) then return "Cant" end local master1 = isSummon(cid) and getCreatureMaster(cid) or cid local master2 = isSummon(pid) and getCreatureMaster(pid) or pid if getPlayerStorageValue(master1, 6598754) >= 1 and getPlayerStorageValue(master2, 6598755) >= 1 then return "Can" end if getPlayerStorageValue(master1, 6598755) >= 1 and getPlayerStorageValue(master2, 6598754) >= 1 then ---estar em times diferentes return "Can" end ---- if getTileInfo(getThingPos(cid)).pvp then return "Can" end if ehMonstro(cid) and ehMonstro(pid) and not isSummon(cid) and not isSummon(pid) then --alterado v2.9.1 return "Can" end return "Cant" end - é so Fazer o mesmo esquema dessas storages que tem dentro dessa Funçao que eu postei (Copiar e Colar e alterar nomes e valores) ae , agora um outro problema, ele esta atacando apenas se tiver pvp tile, gostaria de saber se tem como arrumar para poder fazer duelos em qualquer lugar.
Postado Junho 20, 2015 10 anos me mostre como voce fez? no config.lua esta como PVP/Non-PVP/PVP-ENFORCED? Essa Parte aqui: if getTileInfo(getThingPos(cid)).pvp thenreturn "Can"end - Ativa o PVP Tile Editado Junho 20, 2015 10 anos por Nextbr (veja o histórico de edições)
Postado Junho 20, 2015 10 anos Autor me mostre como voce fez? no config.lua esta como PVP/Non-PVP/PVP-ENFORCED? Essa Parte aqui: if getTileInfo(getThingPos(cid)).pvp then return "Can" end - Ativa o PVP Tile worldType = "pvp-enforced" Segue os links das prints do sistema funcionando: http://prntscr.com/7j7lv2 http://prntscr.com/7j7lzz http://prntscr.com/7j7m88 http://prntscr.com/7j7niu O sistema não esta permitindo dar target, porém o dano é adicionado, assim que conseguir resolver irei disponibilizar o sistema para a galera Editado Junho 20, 2015 10 anos por babyloiz (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.