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
Grupo: Infante
Registrado: 13/10/08
Posts: 1.6k
Reputação: +420
Char no Tibia: Demonbholder

info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: 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
Grupo: Infante
Registrado: 13/10/08
Posts: 1.6k
Reputação: +420
Char no Tibia: 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.
Editado Julho 14 por Demonbholder
info
Grupo: Visconde
Registrado: 17/01/11
Posts: 343
Reputação: +46
Char no Tibia: 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
Editado Julho 14 por xotservx
info
Grupo: Infante
Registrado: 13/10/08
Posts: 1.6k
Reputação: +420
Char no Tibia: Demonbholder

Se eu não me engano a raça que ele se refere não é a vocação.
humm |:
info
Grupo: Visconde
Registrado: 17/01/11
Posts: 343
Reputação: +46
Char no Tibia: 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
Editado Julho 14 por OtheReality



info
Grupo: Visconde
Registrado: 17/01/11
Posts: 343
Reputação: +46
Char no Tibia: 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.