trample Posted December 16, 2017 at 11:15 PM Share Posted December 16, 2017 at 11:15 PM nao encontro o erro simplesmente nao funciona gostaria de trocar o cheque won no caso por coins MDS mas me vem dar erro na npc nao aparece a qest .foi criada do zero esta qest porem tem erros quem puder ajudar agradecido aqui . quest won_em_coins begin state start begin when 20092.chat."Trocar Won por Coins" begin say_title("Madame Origens: ") say("") say("Bem vindo ao menu de trocas Won em Coins.") local gold_valor = pc.getgold() local quantidade_won = mysql_query("SELECT won From player.player where name = '"..pc.get_name().."';") say_title("Trocar won em Coins: ") say("") say("Você possui atualmente: ", quantidade_won, " em sua conta.") say("") local qtd = select("Trocar 20 Wons por 10 MDS", "Trocar 40 Wons por 20 MDS","Trocar 80 Wons por 40 MDS", "Sair") if qtd == 1 then say_title("Trocar won em Coins: ") say("") say("Você está prestes a trocar 20 won por 10 MD'S") say("Deseja continuar?.") local confirmacao1 = select ("Confirmar Troca", "Sair") if confirmacao1 == 1 then if quantidade_won < 20 then syschat("VocÊ não tem 20 wons para realizar está trocar.") return elseif quantidade_won >= 20 then syschat("[Trocar Won por Coins]: Troca realizada com Sucesso.") chat("[Trocar Won por Coins]: Você acaba de trocar 20 Won por 10 Md's.") return else return end elseif qtd == 2 then return elseif qtd == 3 then return elseif menu == 2 then return end end end end Link to comment Share on other sites More sharing options...
LuizFernando Posted December 16, 2017 at 11:24 PM Share Posted December 16, 2017 at 11:24 PM Está aqui, a quest oficial do sistema de won já traduzida! sistema_de_won.lua Link to comment Share on other sites More sharing options...
trample Posted December 16, 2017 at 11:29 PM Author Share Posted December 16, 2017 at 11:29 PM pois e mano eu tenho ela , porem ela nao funciona qando vou trocar won por coins na tabela mysql Link to comment Share on other sites More sharing options...
Mário. Posted December 17, 2017 at 05:05 PM Share Posted December 17, 2017 at 05:05 PM Ela não funciona porque não existe nenhum código que o faça trocar (?) Tenta algo como isto: quest trample begin state start begin when 9002.chat."Trocar won por moedas" begin local count = mysql_query("SELECT won From player.player where name = '"..pc.get_name().."';") say_title("Trample:") say("Escolhe a opção:") local escolha = select("20 won por 10 moedas","40 won por 20 moedas","80 won por 40 moedas") if escolha == 1 then if count < 20 then say_title("Trample:") say("Não tens esse montante") return else pc.change_cheque(-20) mysql_query("UPDATE account.account SET coins = 10 WHERE id ='"..pc.get_account_id().."' LIMIT 1") say_title("Trample:") say("A troca foi feita com sucesso.") end elseif escolha == 2 then if count < 40 then say_title("Trample:") say("Não tens esse montante") return else pc.change_cheque(-40) mysql_query("UPDATE account.account SET coins = 20 WHERE id ='"..pc.get_account_id().."' LIMIT 1") say_title("Trample:") say("A troca foi feita com sucesso.") end else if count < 80 then say_title("Trample:") say("Não tens esse montante") return else pc.change_cheque(-80) mysql_query("UPDATE account.account SET coins = 40 WHERE id ='"..pc.get_account_id().."' LIMIT 1") say_title("Trample:") say("A troca foi feita com sucesso.") end end end end end Link to comment Share on other sites More sharing options...
[Admin] tierrilopes Posted December 17, 2017 at 07:08 PM Share Posted December 17, 2017 at 07:08 PM Usando exemplo do Mário, cria função nova Quest que leve 2 argumentos. Argumento 1 = won a dar Argumento 2 = coins a receber PC.change_won(50,600) por exemplo Link to comment Share on other sites More sharing options...
trample Posted December 17, 2017 at 08:07 PM Author Share Posted December 17, 2017 at 08:07 PM top mano, vou tentar aqui . Link to comment Share on other sites More sharing options...
PACI Posted December 18, 2017 at 03:22 AM Share Posted December 18, 2017 at 03:22 AM 10 horas atrás, Mário. disse: local count = mysql_query("SELECT won From player.player where name = '"..pc.get_name().."';") Aqui, count é uma tabela ou nil, nunca uma string ou número. Link to comment Share on other sites More sharing options...
trample Posted December 18, 2017 at 03:06 PM Author Share Posted December 18, 2017 at 03:06 PM valeu estava a tentar a horas aqui vamos ver se agora vai Link to comment Share on other sites More sharing options...
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