[Admin] tierrilopes Posted December 15, 2015 at 03:39 AM Share Posted December 15, 2015 at 03:39 AM Serve para que os os jogadores ao clicarem nos vouchers (50,100,500,1000 MDS) recebam imediatamente a quantidade respectiva na sua conta. Sem quest. Ir até ao ficheiro char_item.cpp: Procurar por: switch (item->GetType()) Adicionar isto acima: switch (item->GetVnum()) { // Moedas sexy. case 80014: case 80015: case 80016: case 80017: int idx[4]; idx[0] = 100; idx[1] = 500; idx[2] = 1000; idx[3] = 50; int idxs; if (item->GetVnum() == 80014) idxs = 0; if (item->GetVnum() == 80015) idxs = 1; if (item->GetVnum() == 80016) idxs = 2; if (item->GetVnum() == 80017) idxs = 3; long val; val = idx[idxs]; if (SetCoins(val)) { ChatPacket(CHAT_TYPE_INFO, "Recebeste %ld moedas dragao.", val); item->SetCount(item->GetCount() - 1); } else { ChatPacket( CHAT_TYPE_INFO, "Ocorreu um erro ao receber as moedas. Fala com um administrador."); } return 1; break; default: break; } Deverá ficar assim: Ir até ao ficheiro char.cpp: Adicionar isto no final do ficheiro: int CHARACTER::SetCoins(long coins) { SQLMsg *msg; msg = DBManager::instance().DirectQuery( "UPDATE account.account SET coins = coins + '%ld' WHERE id = '%d'", coins, GetAID()); if (msg->uiSQLErrno != 0) { sys_err("pc_update_coins query failed"); return false; } return true; } Ir até ao ficheiro char.h: Procurar por isto: public: bool ItemProcess_Polymorph(LPITEM item); Adicionar debaixo: int SetCoins(long coins = 0); Deverá ficar assim: 2 Link to comment Share on other sites More sharing options...
pedrorrr Posted December 15, 2015 at 04:11 AM Share Posted December 15, 2015 at 04:11 AM Procurava mesmo isto. Muito obrigado @tierrilopes :1: Link to comment Share on other sites More sharing options...
Sadness Posted December 15, 2015 at 09:56 AM Share Posted December 15, 2015 at 09:56 AM Source master Continua Link to comment Share on other sites More sharing options...
pedrorrr Posted December 19, 2015 at 01:48 PM Share Posted December 19, 2015 at 01:48 PM Testado e aprovado, funciona a 100% 2 Link to comment Share on other sites More sharing options...
Karbust Posted May 1, 2016 at 02:41 PM Share Posted May 1, 2016 at 02:41 PM Que type temos de meter nos vouchers? Link to comment Share on other sites More sharing options...
pedrorrr Posted May 1, 2016 at 02:52 PM Share Posted May 1, 2016 at 02:52 PM @Karbust Type -> 18 1 Link to comment Share on other sites More sharing options...
Karbust Posted May 1, 2016 at 02:52 PM Share Posted May 1, 2016 at 02:52 PM Então é como se fizesse por quest mas sem quest certo? Link to comment Share on other sites More sharing options...
pedrorrr Posted May 1, 2016 at 02:54 PM Share Posted May 1, 2016 at 02:54 PM Exactamente. Porem por source fica 100% melhor 100% organizado e 100% seguro Link to comment Share on other sites More sharing options...
Guest Gamers Posted October 3, 2016 at 05:09 PM Share Posted October 3, 2016 at 05:09 PM é 100% seguro, ou tem formas de bugar ? Link to comment Share on other sites More sharing options...
pedrorrr Posted October 3, 2016 at 09:57 PM Share Posted October 3, 2016 at 09:57 PM Até hoje passado vários testes não arranjei maneira de tal. Por isso eu dou como 100% seguro. Link to comment Share on other sites More sharing options...
moikano22 Posted February 25, 2018 at 09:46 PM Share Posted February 25, 2018 at 09:46 PM Boas amigos, Ao colocar isto na source da 2 erros conceguem ajudar sfv? Citar SetCoins was note declared on this scope OBJDIR/char_item.o' failed *** [all] Error2 Link to comment Share on other sites More sharing options...
[Admin] tierrilopes Posted February 25, 2018 at 10:28 PM Author Share Posted February 25, 2018 at 10:28 PM Faltou-te último passo do tutorial 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