Ir para conteúdo

Featured Replies

Postado

1.2

Colocar pz no sistema

não e um erro o sistema foi feito para ADM mas eu tirei os requisitos e agora funciona para player mas eu queria coloca pra funciona apenas na protection zone e não to conseguindo 

Alguém pode me ajudar

  Quote

--Em creaturescripts

function onModalWindow(player, modalWindowId, buttonId, choiceId)
    if modalWindowId == 1003 then
        if (buttonId == 1) then
            local pos = 0
            if (choiceId == 1) then
                pos = {x=100, y=40, z=6}
            elseif (choiceId == 2) then
                pos = {x=2466, y=2680, z=7}
            elseif (choiceId == 3) then
                pos = {x=267, y=122, z=5}
            elseif (choiceId == 4) then
                pos = {x=296, y=177, z=7}
            elseif (choiceId == 5) then
                pos = {x=74, y=262, z=7}
            elseif (choiceId == 6) then
                pos = {x=290, y=352, z=7}
            elseif (choiceId == 7) then
                pos = {x=252, y=261, z=8}
            elseif (choiceId == 8) then
                pos = {x=510, y=285, z=7}
            elseif (choiceId == 9) then
                pos = {x=1553, y=2493, z=7}
            elseif (choiceId == 10) then
                pos = {x=2021, y=2360, z=7}
            elseif (choiceId == 11) then
                pos = {x=393, y=75, z=6}
            elseif (choiceId == 12) then
                pos = {x=522, y=762, z=5}
            elseif (choiceId == 13) then
                pos = {x=741, y=371, z=6}
            elseif (choiceId == 14) then
                pos = {x=209, y=885, z=7}
            elseif (choiceId == 15) then
                pos = {x=1367, y=196, z=6}
            end
            player:teleportTo(pos, false)
        end
    end
    return true
end

 

  Quote

-- Em talkactions

local modaldialog = {
    title = "Quick Access",
    message = "Where are you going?",
    buttons = {
        { id = 1, text = "Go" },
        { id = 2, text = "Cancel" },
    },
    buttonEnter = 1,
    buttonEscape = 2,
    choices = {
        { id = 1, text = "Dorion" },
        { id = 2, text = "Thais" },
        { id = 3, text = "Mirand Theraan" },
        { id = 4, text = "Saari" },        
        { id = 5, text = "Alfon" },        
        { id = 6, text = "Venonh" },        
        { id = 7, text = "Infernium" },
        { id = 8, text = "Anknor" },        
        { id = 9, text = "Yalahar" },        
        { id = 10, text = "Smallville" },        
        { id = 11, text = "Flam" },
        { id = 12, text = "Farmine" },        
        { id = 13, text = "Roshamuul" },        
        { id = 14, text = "Gray Island" },        
        { id = 15, text = "Goroma" }                
    },
    popup = false
}

function onSay(player, words, param)
    
    modalWindow = ModalWindow(1003, modaldialog.title, modaldialog.message)
    if modalWindow:getId() == 1003 then
        for _, v in ipairs(modaldialog.buttons) do
            modalWindow:addButton(v.id, v.text)
        end
        for _, v in ipairs(modaldialog.choices) do
            modalWindow:addChoice(v.id, v.text)
        end
        modalWindow:setDefaultEnterButton(modaldialog.buttonEnter)
        modalWindow:setPriority(modaldialog.popup)
        modalWindow:setDefaultEscapeButton(modaldialog.buttonEscape)
    end
    modalWindow:sendToPlayer(player)
    player:registerEvent("ModalTP")
    return false
end
 

 

Você tem o código disponível? Se tiver publique-o aqui: 

 

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

 

Postado

Substitua seu talkaction por este:

-- Em talkactions

local modaldialog = {
    title = "Quick Access",
    message = "Where are you going?",
    buttons = {
        { id = 1, text = "Go" },
        { id = 2, text = "Cancel" },
    },
    buttonEnter = 1,
    buttonEscape = 2,
    choices = {
        { id = 1, text = "Dorion" },
        { id = 2, text = "Thais" },
        { id = 3, text = "Mirand Theraan" },
        { id = 4, text = "Saari" },        
        { id = 5, text = "Alfon" },        
        { id = 6, text = "Venonh" },        
        { id = 7, text = "Infernium" },
        { id = 8, text = "Anknor" },        
        { id = 9, text = "Yalahar" },        
        { id = 10, text = "Smallville" },        
        { id = 11, text = "Flam" },
        { id = 12, text = "Farmine" },        
        { id = 13, text = "Roshamuul" },        
        { id = 14, text = "Gray Island" },        
        { id = 15, text = "Goroma" }                
    },
    popup = false
}

function onSay(player, words, param)
	if (Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE)) then 
		modalWindow = ModalWindow(1003, modaldialog.title, modaldialog.message)
		if modalWindow:getId() == 1003 then
			for _, v in ipairs(modaldialog.buttons) do
				modalWindow:addButton(v.id, v.text)
			end
			for _, v in ipairs(modaldialog.choices) do
				modalWindow:addChoice(v.id, v.text)
			end
			modalWindow:setDefaultEnterButton(modaldialog.buttonEnter)
			modalWindow:setPriority(modaldialog.popup)
			modalWindow:setDefaultEscapeButton(modaldialog.buttonEscape)
		end
		modalWindow:sendToPlayer(player)
		player:registerEvent("ModalTP")
	else
		player:sendCancelMessage("You need to be in a safe zone to use teleport system.")
	end
    return false
end

 

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

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