function onCombat(cid, target) local storage = 30000 local valor = 1 if getPlayerStorageValue(cid, storage) == valor and getPlayerStorageValue(target, storage) == valor then return FALSE end return TRUE end
info
Group: Infante
Joined: 13/10/08
Posts: 1.6k
Reputation: +420
Tibia Character: Demonbholder

info
Group: Herói
Joined: 20/05/10
Posts: 3.4k
Reputation: +1.5k
Gender: Masculino

só completando ^^
function onCombat(cid, target)
local storage = 59000
if (isPlayer(cid) and isPlayer(target)) then
if getPlayerStorageValue(cid, storage) >= 1 and getPlayerStorageValue(target, storage) >= 1 then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER)
return FALSE
else
return TRUE
end
else
return TRUE
end
return TRUE
end
info
Group: Infante
Joined: 13/10/08
Posts: 1.6k
Reputation: +420
Tibia Character: Demonbholder

Pra que tanto return? Ahsuhsuhsua, assim vai do mesmo jeito:
function onCombat(cid, target)
local storage = 59000
if (isPlayer(cid) and isPlayer(target)) then
if getPlayerStorageValue(cid, storage) >= 1 and getPlayerStorageValue(target, storage) >= 1 then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER)
return FALSE
end
end
return TRUE
end
Hasta luego.
Edited Julho 14 by Demonbholder
info
Group: Visconde
Joined: 17/01/11
Posts: 343
Reputation: +46
Tibia Character: Zodriac

Vlw Demonb.
Vlw Vodkart.
Agora eu tenho que sair mas quando chear eu testo.
Brigadão. =D
pq ñ fazer diretamente pela vocation
, vc escreveu em pekeno para que da mesma vocação não se ataque, ficaria assim:
function onCombat(cid, target)
if isPlayer(cid) and isPlayer(target) then
if getPlayerVocation(cid) == getPlayerVocation(target) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER), return false
end
end
return true
end
Edited Julho 14 by xotservx
info
Group: Infante
Joined: 13/10/08
Posts: 1.6k
Reputation: +420
Tibia Character: Demonbholder

Se eu não me engano a raça que ele se refere não é a vocação.
humm |:
info
Group: Visconde
Joined: 17/01/11
Posts: 343
Reputation: +46
Tibia Character: Zodriac

Obrigado a todos,
Rep + demonb. Que foi o primeiro a responder.
E realmente as raças não são separadas por vocation.
apenas por essa storage.
edit:
pode ser movido/fechado
Edited Julho 14 by OtheReality



info
Group: Visconde
Joined: 17/01/11
Posts: 343
Reputation: +46
Tibia Character: Zodriac
Bem não sei se isso é possível.
Caso seja, não a muito oque explicar:
Se dois players tiverem esta storage eles simplesmente não poderão se atacar.
Só esclarecendo, eu pretendo usar para fazer com que duas pessoas da mesma raça não se matem em meu servidor.
Obrigado.