20
pedido

Não Atacar Mesmo Storage

Por 20cm, 20 de jun. de 2012 em Scripts

7
1.2k
20cm2
20 de junho de 2012 às 23:24

function onAttack(cid, target)

if isPlayer(target) then
 if getPlayerStorageValue(target,timest) == getPlayerStorageValue(cid,timest) then
  doPlayerSendTextMessage(cid,5,"Você não pode atacar o seu próprio time.")
     doCreatureSetSkullType(cid, 0) 
  return false
  doPlayerSendTextMessage(cid,5,"Você não psssssacar o seu próprio time.")
  else
 end
end
return true
end

 

n funciona , nem ontarget

alguém sabe como fazer isso ? abs

MaXwEllDeNM
21 de junho de 2012 às 12:29

Bem, em primeiro lugar:

 

return false
doPlayerSendTextMessage(cid,5,"Você não psssssacar o seu próprio time.")

 

depois de um return você não pode colocar nenhuma função!

 

e outra

 

if getPlayerStorageValue(target,timest) == getPlayerStorageValue(cid,timest) then

 

timest não foi definido, é nulo

 

function onAttack(cid, target)
    local timest = 71237

    if isPlayer(target) then
		    if (getPlayerStorageValue(target, timest) == getPlayerStorageValue(cid, timest)) then
				    doPlayerSendTextMessage(cid,5,"Você não pode atacar o seu próprio time.")
				    doCreatureSetSkullType(cid, 0)
				    return false
		    end
    end

    return true
end

20cm2
21 de junho de 2012 às 13:51

Na verdade, ele está na lib xd

VodkartV
21 de junho de 2012 às 14:09

pode usar o onCombat tbm

 

function onCombat(cid, target)
if isPlayer(cid) and isPlayer(target) then
if getPlayerStorageValue(cid, timest) == getPlayerStorageValue(target, timest) then
doPlayerSendCancel(cid, "You may not attack your team mates.")
return false
end
end
return true
end

MaXwEllDeNM
21 de junho de 2012 às 15:35

O melhor é usar o onCombat e o onAttack mesmo! Pois o Attack impede o player de atacar, e o combat impede de ataques de área(combates), atingirem o player .-.

20cm2
21 de junho de 2012 às 19:28

Vodkart sanou o tópico

Podem fechar

ErimythE
21 de junho de 2012 às 23:10

Sanada

Movido.