OT

Players Com "x" Storage Não Podem Se Atacar.

Por othereality, 14 de jul. de 2011 em Scripts

9
1.6k
otherealityO
14 de julho de 2011 às 03:22

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.

14 de julho de 2011 às 05:49
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

VodkartV
14 de julho de 2011 às 10:48

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

14 de julho de 2011 às 13:04

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

otherealityO
14 de julho de 2011 às 14:10

Vlw Demonb.

Vlw Vodkart.

 

Agora eu tenho que sair mas quando chear eu testo.

 

Brigadão. =D

meubkM
14 de julho de 2011 às 14:57

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

14 de julho de 2011 às 15:24

Se eu não me engano a raça que ele se refere não é a vocação.

meubkM
14 de julho de 2011 às 15:33

humm |:

otherealityO
14 de julho de 2011 às 16:50

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