main Posted October 16, 2018 Posted October 16, 2018 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
DNL291 Posted October 16, 2018 Posted October 16, 2018 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. 1 Please do not PM me with scripting related question nor support, use the forums instead.
Moderators Lord Henry Posted October 16, 2018 Moderators Posted October 16, 2018 No lugar do print ("3"), coloque print (getPlayerName(v)) e nos diga o que aparece. 1 Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanks! Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment Discord Oficial do MTA: https://mtasa.com/discord Blacklist e Whitelist de Scripters: Planilha Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.
main Posted October 16, 2018 Author Posted October 16, 2018 Consegui arrumar, o loop funcionava normalmente, o problema era na verificação e na data.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now