Ir para conteúdo

Featured Replies

Postado

Tipo, a msg de "sua guild já domina" aparece? Testa isso:

function onStepIn(cid, item, pos, fromPosition)
	local pos = getThingPos(cid)
	
	if item.actionid == 16203 then
		if not isPlayer(cid) then
			return true
		end
		if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then
			doSendMagicEffect(getThingPos(cid), 14)
			doSendAnimatedText(pos, "CoH", math.random(1, 255))
		else
			doSendMagicEffect(getThingPos(cid), 2)
			doTeleportThing(cid, fromPosition, false)
			doPlayerSendCancel(cid, "[CoH] Você não pertence á guild "..getGlobalStorageValue(COH_STATUS)..".")
		end
		return true
	end
	
	if item.actionid == 16202 then
		if not isPlayer(cid) then
			return true
		end
		
		if getPlayerGuildId(cid) > 0 then
			if (getGlobalStorageValue(COH_STATUS) ~= getPlayerGuildName(cid)) then
				doPlayerSendTextMessage(cid, 20, "[Castle of Honor] Você e sua guild estão no comando, os antigos donos ["..tostring(getGlobalStorageValue(COH_STATUS)).."] podem se vingar!")
				setGlobalStorageValue(COH_PREPARE1, -1)
				setGlobalStorageValue(COH_PREPARE2, -1)
				setGlobalStorageValue(COH_STATUS, getPlayerGuildName(cid))
				doCastleRemoveEnemies()
				doBroadcastMessage("[Castle of Honor] O jogador ["..getCreatureName(cid).."] e sua guild ["..getPlayerGuildName(cid).."] estão no comando do castelo, vá dominar e impedir isso!")
			else
				doTeleportThing(cid, fromPosition)
				doPlayerSendCancel(cid, "[CoH] Sua guild já domina este castelo.")
			end
		else
			doSendMagicEffect(pos, 2)
			doTeleportThing(cid, fromPosition, false)
			doPlayerSendCancel(cid, "[CoH] Você não possui uma guild.")
		end
		return true
	end
	
	if item.actionid == 16200 then
		if not isPlayer(cid) then
			return true
		end
		if getPlayerGuildId(cid) > 0 then
			doSendAnimatedText(pos, "CoH", math.random(1, 255))
			if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) and ((getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid))) then
				setGlobalStorageValue(COH_PREPARE1, getPlayerGuildName(cid))
				doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está tentando dominar o castelo, preparem-se!")
			end
		else
			doSendMagicEffect(pos, 2)
			doTeleportThing(cid, fromPosition, true)
			doPlayerSendCancel(cid, "[CoH] Você não possui uma guild.")
			return true
		end
	end
	
	if item.actionid == 16201 then
		if not isPlayer(cid) then
			return true
		end
		doSendAnimatedText(pos, "CoH", math.random(1, 255))
		if (getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid)) then
			setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid))
			doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está muito próxima do domínio, ataquem!")
		end
	end
	return true
end

 

Programador PHP, Lua, Java, database administrator.

 

"Nada é verdade, tudo é permitido."

Requiescat in pace.

  • Respostas 10
  • Visualizações 487
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor
58 minutos atrás, Nazo disse:

Tipo, a msg de "sua guild já domina" aparece? Testa isso:


function onStepIn(cid, item, pos, fromPosition)
	local pos = getThingPos(cid)
	
	if item.actionid == 16203 then
		if not isPlayer(cid) then
			return true
		end
		if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then
			doSendMagicEffect(getThingPos(cid), 14)
			doSendAnimatedText(pos, "CoH", math.random(1, 255))
		else
			doSendMagicEffect(getThingPos(cid), 2)
			doTeleportThing(cid, fromPosition, false)
			doPlayerSendCancel(cid, "[CoH] Você não pertence á guild "..getGlobalStorageValue(COH_STATUS)..".")
		end
		return true
	end
	
	if item.actionid == 16202 then
		if not isPlayer(cid) then
			return true
		end
		
		if getPlayerGuildId(cid) > 0 then
			if (getGlobalStorageValue(COH_STATUS) ~= getPlayerGuildName(cid)) then
				doPlayerSendTextMessage(cid, 20, "[Castle of Honor] Você e sua guild estão no comando, os antigos donos ["..tostring(getGlobalStorageValue(COH_STATUS)).."] podem se vingar!")
				setGlobalStorageValue(COH_PREPARE1, -1)
				setGlobalStorageValue(COH_PREPARE2, -1)
				setGlobalStorageValue(COH_STATUS, getPlayerGuildName(cid))
				doCastleRemoveEnemies()
				doBroadcastMessage("[Castle of Honor] O jogador ["..getCreatureName(cid).."] e sua guild ["..getPlayerGuildName(cid).."] estão no comando do castelo, vá dominar e impedir isso!")
			else
				doTeleportThing(cid, fromPosition)
				doPlayerSendCancel(cid, "[CoH] Sua guild já domina este castelo.")
			end
		else
			doSendMagicEffect(pos, 2)
			doTeleportThing(cid, fromPosition, false)
			doPlayerSendCancel(cid, "[CoH] Você não possui uma guild.")
		end
		return true
	end
	
	if item.actionid == 16200 then
		if not isPlayer(cid) then
			return true
		end
		if getPlayerGuildId(cid) > 0 then
			doSendAnimatedText(pos, "CoH", math.random(1, 255))
			if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) and ((getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid))) then
				setGlobalStorageValue(COH_PREPARE1, getPlayerGuildName(cid))
				doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está tentando dominar o castelo, preparem-se!")
			end
		else
			doSendMagicEffect(pos, 2)
			doTeleportThing(cid, fromPosition, true)
			doPlayerSendCancel(cid, "[CoH] Você não possui uma guild.")
			return true
		end
	end
	
	if item.actionid == 16201 then
		if not isPlayer(cid) then
			return true
		end
		doSendAnimatedText(pos, "CoH", math.random(1, 255))
		if (getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid)) then
			setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid))
			doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está muito próxima do domínio, ataquem!")
		end
	end
	return true
end

agora da "sorry , not possible" mas eu ainda posso passar pelo trono =/

 

Postado

Testa isso:

function onStepIn(cid, item, pos, fromPosition)
	local pos = getThingPos(cid)
	
	if item.actionid == 16203 then
		if not isPlayer(cid) then
			return true
		end
		if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then
			doSendMagicEffect(getThingPos(cid), 14)
			doSendAnimatedText(pos, "CoH", math.random(1, 255))
		else
			doSendMagicEffect(getThingPos(cid), 2)
			doTeleportThing(cid, fromPosition, false)
			doPlayerSendCancel(cid, "[CoH] Você não pertence á guild "..getGlobalStorageValue(COH_STATUS)..".")
		end
		return true
	end
	
	if item.actionid == 16202 then
		if not isPlayer(cid) then
			return true
		end
		
		if getPlayerGuildId(cid) > 0 then
			if (getGlobalStorageValue(COH_STATUS) ~= getPlayerGuildName(cid)) then
				doPlayerSendTextMessage(cid, 20, "[Castle of Honor] Você e sua guild estão no comando, os antigos donos ["..tostring(getGlobalStorageValue(COH_STATUS)).."] podem se vingar!")
				setGlobalStorageValue(COH_PREPARE1, -1)
				setGlobalStorageValue(COH_PREPARE2, -1)
				setGlobalStorageValue(COH_STATUS, getPlayerGuildName(cid))
				doCastleRemoveEnemies()
				doBroadcastMessage("[Castle of Honor] O jogador ["..getCreatureName(cid).."] e sua guild ["..getPlayerGuildName(cid).."] estão no comando do castelo, vá dominar e impedir isso!")
			else
				doTeleportThing(cid, fromPosition, true)
				doPlayerSendCancel(cid, "[CoH] Sua guild já domina este castelo.")
			end
		else
			doSendMagicEffect(pos, 2)
			doTeleportThing(cid, fromPosition, false)
			doPlayerSendCancel(cid, "[CoH] Você não possui uma guild.")
		end
		return true
	end
	
	if item.actionid == 16200 then
		if not isPlayer(cid) then
			return true
		end
		if getPlayerGuildId(cid) > 0 then
			doSendAnimatedText(pos, "CoH", math.random(1, 255))
			if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) and ((getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid))) then
				setGlobalStorageValue(COH_PREPARE1, getPlayerGuildName(cid))
				doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está tentando dominar o castelo, preparem-se!")
			end
		else
			doSendMagicEffect(pos, 2)
			doTeleportThing(cid, fromPosition, true)
			doPlayerSendCancel(cid, "[CoH] Você não possui uma guild.")
			return true
		end
	end
	
	if item.actionid == 16201 then
		if not isPlayer(cid) then
			return true
		end
		doSendAnimatedText(pos, "CoH", math.random(1, 255))
		if (getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid)) then
			setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid))
			doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está muito próxima do domínio, ataquem!")
		end
	end
	return true
end

Perdão por tantas tentativas, sou meio desatento quando não faço código testando xd

Programador PHP, Lua, Java, database administrator.

 

"Nada é verdade, tudo é permitido."

Requiescat in pace.

  • 2 weeks later...
Postado
Em 19/01/2018 em 02:19, Fernandooww disse:

nao funcionou =/

Erro na distro meu chapa?

Programador PHP, Lua, Java, database administrator.

 

"Nada é verdade, tudo é permitido."

Requiescat in pace.

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