Ir para conteúdo

Featured Replies

Postado
local config = {
	redTeam = 1,
	blueTeam = 2,
	gametime = 2000,
	redTeamStorage = 2001,
	blueTeamStorage = 2002,
	outfitRed = {lookType = 128, lookHead = 94, lookAddons = 2, lookLegs = 94, lookBody = 94, lookFeet = 94},
	outfitBlue = {lookType = 128, lookHead = 88, lookAddons = 2, lookLegs = 88, lookBody = 88, lookFeet = 88},
	war = {
		fromPos = {x=638, y=711, z=7, stackpos=253},
		toPos = {x=751, y=780, z=7, stackpos=253},
		rewardRoom = {x=636,y=662,z=7,stackpos=1},
		removePlayer = {x=518, y=840, z=7, stackpos=253}
	}
}

local function TpWinners(cid)
	for _, pid in ipairs(getPlayersOnline()) do
		if isInArea(getPlayerPosition(pid), config.war.fromPos, config.war.toPos) then
			doTeleportThing(pid, config.war.rewardRoom, false)
		end
	end
end

local function winKill(cid, team)
	addEvent(TpWinners, 5000, cid)
	setGlobalStorageValue(config.redTeamStorage, 0)
	setGlobalStorageValue(config.blueTeamStorage, 0)
	doTeleportThing(cid, config.war.removePlayer)
	if team == 1 then
		doBroadcastMessage("Red Team has won the event!")
	elseif team == 2 then
		doBroadcastMessage("Blue Team has won the event!")
	end
end

local function arenaDeath(cid, team)
	doTeleportThing(cid, config.war.removePlayer)
	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have died, you are eliminated from the event')
	setPlayerStorageValue(cid, 1001, 0)
	setPlayerStorageValue(cid, 1002, 1)
	doRemoveCondition(cid,CONDITION_INFIGHT)
	doRemoveCondition(cid, CONDITION_OUTFIT)
	if team == 1 then
		setGlobalStorageValue(config.redTeamStorage, getGlobalStorageValue(2001) - 1)
	elseif team == 2 then
		setGlobalStorageValue(config.blueTeamStorage, getGlobalStorageValue(2002) - 1)
	end

	if getGlobalStorageValue(2001) == 1 then -- redStorage
		winKill(cid, 2)
	elseif getGlobalStorageValue(2002) == 1 then -- blueStorage
		winKill(cid, 1)
	end
end

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

	if isPlayer(cid) == true and getPlayerStorageValue(cid, 1001) > 0 then
		arenaDeath(cid, team)
		return false
	end
	return true
end 

 

  • Respostas 19
  • Visualizações 838
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor
7 horas atrás, luanluciano93 disse:

local config = {
	redTeam = 1,
	blueTeam = 2,
	gametime = 2000,
	redTeamStorage = 2001,
	blueTeamStorage = 2002,
	outfitRed = {lookType = 128, lookHead = 94, lookAddons = 2, lookLegs = 94, lookBody = 94, lookFeet = 94},
	outfitBlue = {lookType = 128, lookHead = 88, lookAddons = 2, lookLegs = 88, lookBody = 88, lookFeet = 88},
	war = {
		fromPos = {x=638, y=711, z=7, stackpos=253},
		toPos = {x=751, y=780, z=7, stackpos=253},
		rewardRoom = {x=636,y=662,z=7,stackpos=1},
		removePlayer = {x=518, y=840, z=7, stackpos=253}
	}
}

local function TpWinners(cid)
	for _, pid in ipairs(getPlayersOnline()) do
		if isInArea(getPlayerPosition(pid), config.war.fromPos, config.war.toPos) then
			doTeleportThing(pid, config.war.rewardRoom, false)
		end
	end
end

local function winKill(cid, team)
	addEvent(TpWinners, 5000, cid)
	setGlobalStorageValue(config.redTeamStorage, 0)
	setGlobalStorageValue(config.blueTeamStorage, 0)
	doTeleportThing(cid, config.war.removePlayer)
	if team == 1 then
		doBroadcastMessage("Red Team has won the event!")
	elseif team == 2 then
		doBroadcastMessage("Blue Team has won the event!")
	end
end

local function arenaDeath(cid, team)
	doTeleportThing(cid, config.war.removePlayer)
	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have died, you are eliminated from the event')
	setPlayerStorageValue(cid, 1001, 0)
	setPlayerStorageValue(cid, 1002, 1)
	doRemoveCondition(cid,CONDITION_INFIGHT)
	doRemoveCondition(cid, CONDITION_OUTFIT)
	if team == 1 then
		setGlobalStorageValue(config.redTeamStorage, getGlobalStorageValue(2001) - 1)
	elseif team == 2 then
		setGlobalStorageValue(config.blueTeamStorage, getGlobalStorageValue(2002) - 1)
	end

	if getGlobalStorageValue(2001) == 1 then -- redStorage
		winKill(cid, 2)
	elseif getGlobalStorageValue(2002) == 1 then -- blueStorage
		winKill(cid, 1)
	end
end

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

	if isPlayer(cid) == true and getPlayerStorageValue(cid, 1001) > 0 then
		arenaDeath(cid, team)
		return false
	end
	return true
end 

 

 

bom dia luan... fiz um teste rapidinho agora de manha, antes de ir trabalhar e nao deu erro na distro, fiz um teste dentro do evento e o player que morre dentro do war_event ele teleporta para o templo, mas a diferenca esta em que a msg de eliminação é mostrada e é removida o outifit. Se ficasse assim estava otimo, mas aconteceu que o player que sobrou no evento, agora nao foi teleportado para a sala de recompensas.

 

sobre o ctf eu testei tambem, e esta teleportando para o templo ainda e nao para o ponto inicial do evento.

 

um detalhe que eu nao disse, os testes que eu estou fazendo , eu nao estou deixando o evento executar no tempo, no globalevents, estou testando pisando no tile diretamente. será que pode ser esse o motivo do bug?

Postado
local config = {
	redTeam = 1,
	blueTeam = 2,
	gametime = 2000,
	redTeamStorage = 2001,
	blueTeamStorage = 2002,
	outfitRed = {lookType = 128, lookHead = 94, lookAddons = 2, lookLegs = 94, lookBody = 94, lookFeet = 94},
	outfitBlue = {lookType = 128, lookHead = 88, lookAddons = 2, lookLegs = 88, lookBody = 88, lookFeet = 88},
	war = {
		fromPos = {x=638, y=711, z=7, stackpos=253},
		toPos = {x=751, y=780, z=7, stackpos=253},
		rewardRoom = {x=636,y=662,z=7,stackpos=1},
		removePlayer = {x=518, y=840, z=7, stackpos=253}
	}
}

local function TpWinners(cid)
	for _, pid in ipairs(getPlayersOnline()) do
		if isInArea(getPlayerPosition(pid), config.war.fromPos, config.war.toPos) then
			doTeleportThing(pid, config.war.rewardRoom, false)
		end
	end
end

local function winKill(cid, team)
	addEvent(TpWinners, 5000, cid)
	setGlobalStorageValue(config.redTeamStorage, 0)
	setGlobalStorageValue(config.blueTeamStorage, 0)
	if team == 1 then
		doBroadcastMessage("Red Team has won the event!")
	elseif team == 2 then
		doBroadcastMessage("Blue Team has won the event!")
	end
end

local function arenaDeath(cid, team)
	doTeleportThing(cid, config.war.removePlayer)
	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have died, you are eliminated from the event')
	setPlayerStorageValue(cid, 1001, 0)
	setPlayerStorageValue(cid, 1002, 1)
	doRemoveCondition(cid,CONDITION_INFIGHT)
	doRemoveCondition(cid, CONDITION_OUTFIT)
	if team == 1 then
		setGlobalStorageValue(config.redTeamStorage, getGlobalStorageValue(2001) - 1)
	elseif team == 2 then
		setGlobalStorageValue(config.blueTeamStorage, getGlobalStorageValue(2002) - 1)
	end

	if getGlobalStorageValue(2001) == 1 then -- redStorage
		winKill(cid, 2)
	elseif getGlobalStorageValue(2002) == 1 then -- blueStorage
		winKill(cid, 1)
	end
end

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

	if isPlayer(cid) == true and getPlayerStorageValue(cid, 1001) > 0 then
		arenaDeath(cid, team)
		return false
	end
	return true
end 

 

Postado
  • Autor
11 horas atrás, luanluciano93 disse:

local config = {
	redTeam = 1,
	blueTeam = 2,
	gametime = 2000,
	redTeamStorage = 2001,
	blueTeamStorage = 2002,
	outfitRed = {lookType = 128, lookHead = 94, lookAddons = 2, lookLegs = 94, lookBody = 94, lookFeet = 94},
	outfitBlue = {lookType = 128, lookHead = 88, lookAddons = 2, lookLegs = 88, lookBody = 88, lookFeet = 88},
	war = {
		fromPos = {x=638, y=711, z=7, stackpos=253},
		toPos = {x=751, y=780, z=7, stackpos=253},
		rewardRoom = {x=636,y=662,z=7,stackpos=1},
		removePlayer = {x=518, y=840, z=7, stackpos=253}
	}
}

local function TpWinners(cid)
	for _, pid in ipairs(getPlayersOnline()) do
		if isInArea(getPlayerPosition(pid), config.war.fromPos, config.war.toPos) then
			doTeleportThing(pid, config.war.rewardRoom, false)
		end
	end
end

local function winKill(cid, team)
	addEvent(TpWinners, 5000, cid)
	setGlobalStorageValue(config.redTeamStorage, 0)
	setGlobalStorageValue(config.blueTeamStorage, 0)
	if team == 1 then
		doBroadcastMessage("Red Team has won the event!")
	elseif team == 2 then
		doBroadcastMessage("Blue Team has won the event!")
	end
end

local function arenaDeath(cid, team)
	doTeleportThing(cid, config.war.removePlayer)
	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have died, you are eliminated from the event')
	setPlayerStorageValue(cid, 1001, 0)
	setPlayerStorageValue(cid, 1002, 1)
	doRemoveCondition(cid,CONDITION_INFIGHT)
	doRemoveCondition(cid, CONDITION_OUTFIT)
	if team == 1 then
		setGlobalStorageValue(config.redTeamStorage, getGlobalStorageValue(2001) - 1)
	elseif team == 2 then
		setGlobalStorageValue(config.blueTeamStorage, getGlobalStorageValue(2002) - 1)
	end

	if getGlobalStorageValue(2001) == 1 then -- redStorage
		winKill(cid, 2)
	elseif getGlobalStorageValue(2002) == 1 then -- blueStorage
		winKill(cid, 1)
	end
end

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

	if isPlayer(cid) == true and getPlayerStorageValue(cid, 1001) > 0 then
		arenaDeath(cid, team)
		return false
	end
	return true
end 

 

 

Luan, fiz um teste aqui agora. 

 

o player que morre ele é teleportado para o local de eliminação, sem life, entao rapidamente, é teleportado para o templo, com a msg de eliminação e não deu erro na distro.

outra coisa esta acontecendo, quando o time vermelho ou azul ganha, tanto faz, a msg de vitoria aparece como se o time azul fosse ganhador sempre, mesmo se o vermelho ganhar. na hora de teleportar para a sala de recompensas, esta certinho. so as msgs de vitorias.

 

obrigado irmao putiz rsrs to feliz, esta quase 100%.

 

mas sendo que o capture the flag, ainda esta dando problema... ele morre e volta para o templo, mas ele vai para o templo com o outifit do evento ainda, ou seja ele deveria voltar para o evento. é so esse problema que esta dando.

 

 

Luan... estou dando uma olhada aqui, tipo entendo pouco de script, mas tudo se forma em uma logica de funçoes correto? pois bem, reparou que vc ja mudou varias vezes e o problema em si esta ruim de ser resolvido(apesar de ter dado uma avanço otimo neste ultimo feedback q vc deu). 

 

então eu estava analisando aqui os scripts e reparei que no:

 

war event: a função de morte esta nesta linha aqui...

 

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

    if isPlayer(cid) == true and getPlayerStorageValue(cid, 1001) > 0 then
        arenaDeath(cid, team)

_________________________________________________________________________________________________

 

Ctf : a função de morte esta nesta linha aqui...

 

function onPrepareDeath(cid, deathList)
    if not isPlayer(cid) and getPlayerStorageValue(cid, 1001) < 1 then

_________________________________________________________________________________________________

 

se parar para analisar há uma coisa em comum com as mortes comuns de player... vejamos isso no script de morte comum.

 

Morte comum: a função da morte esta nesta linha aqui...

 

function onPrepareDeath(cid, deathList)
           if (isPlayer(cid) and (math.abs(config.deadProtection) >= getPlayerLevel(cid))) then
            doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
            setPlayerStorageValue(cid, 6612, 1)
            addEvent(relogPlayer, 1000, cid)

_______________________________________________________________________________________________

 

resumindo, essa função onPrepareDeath ela aparece nos 3 eventos. 

 

vendo ele no creaturescript.xml :

 

<event type="preparedeath" name="Death" event="script" value="playerdeath.lua"/>

<event type="preparedeath" name="WarDeath" event="script" value="war arena/war_death.lua"/>

<event type="preparedeath" name="CtfDeath" event="script" value="capture the flag/ctf_death.lua"/>

 

 

concluindo minha analise, os 3 eventos : war, ctf e morte comuns estão com o mesmo eventtype.

 

como um mero curioso de script(copie e cole kkkkk), será que nao tem como mudar o eventtype do war e do capture the flag? para fzer um teste.

 

ou vc quem conhece bem sobre script, ja descarta esta possibilidade? 

Editado por Lisbeky (veja o histórico de edições)

Postado
  • Autor
Em 01/10/2019 em 09:49, luanluciano93 disse:

local config = {
	redTeam = 1,
	blueTeam = 2,
	gametime = 2000,
	redTeamStorage = 2001,
	blueTeamStorage = 2002,
	outfitRed = {lookType = 128, lookHead = 94, lookAddons = 2, lookLegs = 94, lookBody = 94, lookFeet = 94},
	outfitBlue = {lookType = 128, lookHead = 88, lookAddons = 2, lookLegs = 88, lookBody = 88, lookFeet = 88},
	war = {
		fromPos = {x=638, y=711, z=7, stackpos=253},
		toPos = {x=751, y=780, z=7, stackpos=253},
		rewardRoom = {x=636,y=662,z=7,stackpos=1},
		removePlayer = {x=518, y=840, z=7, stackpos=253}
	}
}

local function TpWinners(cid)
	for _, pid in ipairs(getPlayersOnline()) do
		if isInArea(getPlayerPosition(pid), config.war.fromPos, config.war.toPos) then
			doTeleportThing(pid, config.war.rewardRoom, false)
		end
	end
end

local function winKill(cid, team)
	addEvent(TpWinners, 5000, cid)
	setGlobalStorageValue(config.redTeamStorage, 0)
	setGlobalStorageValue(config.blueTeamStorage, 0)
	if team == 1 then
		doBroadcastMessage("Red Team has won the event!")
	elseif team == 2 then
		doBroadcastMessage("Blue Team has won the event!")
	end
end

local function arenaDeath(cid, team)
	doTeleportThing(cid, config.war.removePlayer)
	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have died, you are eliminated from the event')
	setPlayerStorageValue(cid, 1001, 0)
	setPlayerStorageValue(cid, 1002, 1)
	doRemoveCondition(cid,CONDITION_INFIGHT)
	doRemoveCondition(cid, CONDITION_OUTFIT)
	if team == 1 then
		setGlobalStorageValue(config.redTeamStorage, getGlobalStorageValue(2001) - 1)
	elseif team == 2 then
		setGlobalStorageValue(config.blueTeamStorage, getGlobalStorageValue(2002) - 1)
	end

	if getGlobalStorageValue(2001) == 1 then -- redStorage
		winKill(cid, 2)
	elseif getGlobalStorageValue(2002) == 1 then -- blueStorage
		winKill(cid, 1)
	end
end

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

	if isPlayer(cid) == true and getPlayerStorageValue(cid, 1001) > 0 then
		arenaDeath(cid, team)
		return false
	end
	return true
end 

 

 

@luanluciano93 caso vc não queira mais me dar um suporte em meu poster, teria como vc me comunicar ? só para eu não ficar aguardando e criando expectativa. 

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo