Ir para conteúdo

Featured Replies

Postado

Este tópico foi movido para a área correta. Esta é uma mensagem automática!
Pedimos que leia as regras do fórum!

Spoiler

This topic has been moved to the correct area. This is an automated message!
Please read the forum rules.

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Postado

@Jinx Tenho um sistema para impedir de atacar membros da msm party e da msm guild.

 

Se precisar ta ae

 

Em config.lua adicione:

	noDamageToGuildMates = false	noDamageToPartyMembers = true

 

Em creaturescripts.xml adicione:

<event type="combat" name="combat" script="combat.lua"/>

 

Em creaturescripts/scripts/login.lua adicione:

registerCreatureEvent(cid, "combat")

Na mesma pasta, crie um arquivo lua chamado combat e adicione isso nele:

function onCombat(cid, target) 	
if(isPlayer(cid) and isPlayer(target)) then
if(getConfigValue("noDamageToGuildMates") and getPlayerGuildId(cid) > 0 and getPlayerGuildId(cid) == getPlayerGuildId(target)) then
   return false		

elseif(getConfigValue("noDamageToPartyMembers") and isInParty(target) and getPartyLeader(target) == getPartyLeader(cid)) then

   return false	
end
end	
   return true
end  

 

Qualquer duvida ou erro deixe nos comentários.

Postado
Em 10/11/2017 em 03:29, Jinx disse:

gostaria de um script q o jogar tiver de mc nao pode atakar o outro char dele.

function onLogin(cid)
	registerCreatureEvent(cid, "MC_Block_Target")
	registerCreatureEvent(cid, "MC_Block_Combat")
	return true
end

function onTarget(cid, target)
	if isPlayer(cid) and isPlayer(target) then
		if getPlayerIp(cid) == getPlayerIp(target) then
			return false
		end
		return true
	end
	return true
end

function onCombat(cid, target)
	if isPlayer(cid) and isPlayer(target) then
		if getPlayerIp(cid) == getPlayerIp(target) then
			return false
		end
		return true
	end
	return true
end
<event type="login" name="MC_Block_Login" event="script" value="NoTargetMC.lua"/>
<event type="target" name="MC_Block_Target" event="script" value="NoTargetMC.lua"/>
<event type="combat" name="MC_Block_Combat" event="script" value="NoTargetMC.lua"/>

 

  • 5 years later...
Postado
Em 12/11/2017 em 10:41, Danyel Varejao disse:

function onLogin(cid)
	registerCreatureEvent(cid, "MC_Block_Target")
	registerCreatureEvent(cid, "MC_Block_Combat")
	return true
end

function onTarget(cid, target)
	if isPlayer(cid) and isPlayer(target) then
		if getPlayerIp(cid) == getPlayerIp(target) then
			return false
		end
		return true
	end
	return true
end

function onCombat(cid, target)
	if isPlayer(cid) and isPlayer(target) then
		if getPlayerIp(cid) == getPlayerIp(target) then
			return false
		end
		return true
	end
	return true
end

<event type="login" name="MC_Block_Login" event="script" value="NoTargetMC.lua"/>
<event type="target" name="MC_Block_Target" event="script" value="NoTargetMC.lua"/>
<event type="combat" name="MC_Block_Combat" event="script" value="NoTargetMC.lua"/>

 

Desculpá reviver, mas tem como fazer um que o player que tiver de mc não pode ataka com os dois char o outro player apenas com 1 char.

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo