Jump to content

Loop e verificação


Recommended Posts

Quote

addEventHandler("onColShapeLeave", root, function(player)
	if turfElement[source] and source == turfElement[source][1] then
		if isTimer(turfTimer[source][1]) then
			local aGang = getElementData(source, "warTurf") -- Obtém o nome da gang que dominou a área
			local ps = getGangPlayersInTurf(source, aGang)
			if #ps == 0 then
				exports.Script_Notification:createNotification(player, messages[6], "info")
				turfTimer[source][2] = setTimer(function(aCol, gangA)
					if isTimer(turfTimer[aCol][1]) then killTimer(turfTimer[aCol][1]) end
					setRadarAreaFlashing(turfElement[aCol][2], false)
					print("1")
					for _, v in ipairs(getElementsByType("player")) do
						local playerTeam = getPlayerTeam(v)
						print("2")
						if playerTeam then
							if getTeamName(playerTeam) == gangA then -- Verifica se a gang do player é a mesma que dominou a área
								print("3")
								outputChatBox("AAAAAAAAAAAAAAAAAAAA", v) -- Não executa
							end
						end
					end
				end, 20000, 1, source, aGang)
			end
		end
	end
end)

 

Aparece o print("3") no debug, mas o outputChatBox não é executado

Link to comment
  • Moderators

Deveria ter mostrado a mensagem... Sempre que houver erros assim, depure tudo o que for possível em vez de mostrar uma mensagem qualquer, use todos elementos dentro de tostring, veja o que o valor v mostra, pode ser que tenha conflito com uma variável com o mesmo nome, também edite a mensagem do outputChatBox.

  • Thanks 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...