Ir para conteúdo

Nao Atacar Pokemon do Mesmo Time


RodriigoRobson

Posts Recomendados

Como Eu Coloco Para que nao Ataca Pokemon do Mesmo Time?

Storages: (6666-6674)

 

 

function getMaster(cid)
if isSummon(cid) then
return getCreatureMaster(cid)
elseif isPlayer(cid) then
return cid
end
return false
end



function onTarget(cid, target)

if isPlayer(target) then
if canAttackOther(cid, target) == "Cant" then
doPlayerSendCancel(cid, "You can't attack this player.")
return false
elseif isPlayer(target) and #getCreatureSummons(target) >= 1 and canAttackOther(cid, target) == "Can" then
doPlayerSendCancel(cid, "You can't attack this player.")
return false
end
end

if isInArray(wildTrainers, getCreatureName(target)) then
if #getCreatureSummons(target) >= 1 or getPlayerStorageValue(target, storages.checkWildPokemonStorages) <= 5 then
doPlayerSendCancel(cid, "This trainer still has pokemon.")
return false
end
end

if isSummon(target) then


if getPlayerStorageValue(cid, 8525) <= 0 then
if getPlayerStorageValue(cid, 52482) == getCreatureName(getCreatureMaster(target)) then
else
doPlayerSendCancel(cid, "You can't attack this pokemon.")
return false
end
else
if canAttackOther(cid, target) == "Can" then
else
doPlayerSendCancel(cid, "You can't attack this pokemon.")
return false
end
end




if getCreatureMaster(target) == cid then
doPlayerSendCancel(cid, "You can't attack your pokemon.")
return false
end

end

if getPlayerStorageValue(target, 202) >= 1 then
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

if isNpc(target) then
return false
end


return TRUE
end

function onAttack(cid, target)
if getPlayerStorageValue(target, 17) == 4 then
setPlayerStorageValue(target, 17, 5)
if getPlayerStorageValue(target, 200) == -1 then
setPlayerStorageValue(target, 200, "!, ")
end

setPlayerStorageValue(target, 200, getPlayerStorageValue(target, 200)..""..getCreatureName(cid)..", ")

if #getCreatureSummons(cid) >= 1 then
doMonsterSetTarget(target, getCreatureSummons(cid)[1])
else
doMonsterSetTarget(target, cid)
end

end
return TRUE
end

 

Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...