Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- FilterScript criado por: Rhay_Fither (Sueliton Medeiros)
- Acesse: www.sampevollution.blogspot.com
- Versão: 1.0
- NÃO RETIRE OS CRÉDITOS, NÃO FOI VOCÊ QUE PASSOU MUITO TEMPO CRIANDO E QUEBRANDO A CABEÇA COM BUGS.
- */
- #include <a_samp>
- #include <zcmd>
- #include <DOF2>
- #define FILTERSCRIPT
- //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[ DEFINES ]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- #define SLOTS_SERVIDOR 50 //Aqui você coloca quantos SLOTS são o seu servidor, ou seja, o máximo de jogadores.
- #define PASTA_BANCO "rfBank/%s.ini" //Aqui você coloca o nome da pasta que 'guardará' os arquivos dos jogadores.
- #define MONEY_CURRENT 250 //Coloque aqui quanto o player terá que ter de dinheiro para criar uma conta bancária.
- #define MIN_CARACTERS 4 //Coloque a quantidade mínima de caracters da senha bancária.
- #define MAX_CARACTERS 20 //Coloque a quantidade maxima de caracters da senha bancária.
- #define CHANCES_ENTER 5 //Coloque a quantidade de chanches que o jogador tem para logar na conta bancária.
- //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[ DIALOGS ]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- #define DIALOG_OPEN_CONTA 5600
- #define DIALOG_ENTER_CONTA 5601
- #define DIALOG_DEPOSITAR_CONTA 5602
- #define DIALOG_SACAR_CONTA 5603
- #define DIALOG_MUDAR_SENHA 5604
- #define DIALOG_TRANSFERIR_CLICK 5605
- #define DIALOG_SET_SALDO_CLICK 5606
- #define DIALOG_CONFIRM_RESET 5607
- #define DIALOG_INFOS_PLAYER_CLK 5608
- #define DIALOG_ALL_INFOS 5609
- //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[ MACROS ]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- #define strcatEx(%0,%1,%2,%3); format(%0, sizeof(%0), %2, %3); strcat(%1, %0);
- //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[ VARIAVEIS ]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- enum BankEnum
- {
- bool:CriouConta,
- bool:EntrouConta,
- Saldo,
- ChancesEnter,
- LastDeposito,
- LastSaldo,
- LastTransferido,
- pClicked,
- }
- new Bank[SLOTS_SERVIDOR][BankEnum], PlayerText:BankTextDraws[11][SLOTS_SERVIDOR], PlayerText:BankTDClick[11][SLOTS_SERVIDOR];
- //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[ FORWARD's ]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- forward KickInMsg(idp);
- //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- public OnFilterScriptInit()
- {
- print("\n|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|");
- print("| rfBank System - Carregado com Sucesso |");
- print("| Criado por: Rhay_Fither |");
- print("| WWW.SAMPEVOLLUTION.BLOGSPOT.COM |");
- print("|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|\n");
- for(new i = 0; i < GetMaxPlayers(); ++i) {
- if(IsPlayerConnected(i)) SendClientMessage(i, GetPlayerColor(i), "[INFO]: Sistema de banco ligado."), print("•");
- }
- return 1;
- }
- public OnFilterScriptExit()
- {
- DOF2_Exit();
- //for(new i = 0; i < MAX_TEXT_DRAWS; ++i) print("«•»"); //TESTA ISSO AÍ, E VEJA.
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- BankTextDraws[playerid][0] = CreatePlayerTextDraw(playerid,192.000000, 220.000000, "_"); //Fundo
- PlayerTextDrawBackgroundColor(playerid,BankTextDraws[playerid][0], 255);
- PlayerTextDrawFont(playerid,BankTextDraws[playerid][0], 1);
- PlayerTextDrawLetterSize(playerid,BankTextDraws[playerid][0], 0.500000, 13.700000);
- PlayerTextDrawColor(playerid,BankTextDraws[playerid][0], -1);
- PlayerTextDrawSetOutline(playerid,BankTextDraws[playerid][0], 0);
- PlayerTextDrawSetProportional(playerid,BankTextDraws[playerid][0], 1);
- PlayerTextDrawSetShadow(playerid,BankTextDraws[playerid][0], 1);
- PlayerTextDrawUseBox(playerid,BankTextDraws[playerid][0], 1);
- PlayerTextDrawBoxColor(playerid,BankTextDraws[playerid][0], -8388353);
- PlayerTextDrawTextSize(playerid,BankTextDraws[playerid][0], 419.000000, 0.000000);
- BankTextDraws[playerid][1] = CreatePlayerTextDraw(playerid,188.000000, 200.000000, "_"); //Line Left
- PlayerTextDrawBackgroundColor(playerid,BankTextDraws[playerid][1], 255);
- PlayerTextDrawFont(playerid,BankTextDraws[playerid][1], 1);
- PlayerTextDrawLetterSize(playerid,BankTextDraws[playerid][1], 0.500000, 15.800001);
- PlayerTextDrawColor(playerid,BankTextDraws[playerid][1], -1);
- PlayerTextDrawSetOutline(playerid,BankTextDraws[playerid][1], 0);
- PlayerTextDrawSetProportional(playerid,BankTextDraws[playerid][1], 1);
- PlayerTextDrawSetShadow(playerid,BankTextDraws[playerid][1], 1);
- PlayerTextDrawUseBox(playerid,BankTextDraws[playerid][1], 1);
- PlayerTextDrawBoxColor(playerid,BankTextDraws[playerid][1], 255);
- PlayerTextDrawTextSize(playerid,BankTextDraws[playerid][1], 184.000000, 0.000000);
- BankTextDraws[playerid][2] = CreatePlayerTextDraw(playerid,427.000000, 200.000000, "_"); //Line Right
- PlayerTextDrawBackgroundColor(playerid,BankTextDraws[playerid][2], 255);
- PlayerTextDrawFont(playerid,BankTextDraws[playerid][2], 1);
- PlayerTextDrawLetterSize(playerid,BankTextDraws[playerid][2], 0.500000, 15.800004);
- PlayerTextDrawColor(playerid,BankTextDraws[playerid][2], -1);
- PlayerTextDrawSetOutline(playerid,BankTextDraws[playerid][2], 0);
- PlayerTextDrawSetProportional(playerid,BankTextDraws[playerid][2], 1);
- PlayerTextDrawSetShadow(playerid,BankTextDraws[playerid][2], 1);
- PlayerTextDrawUseBox(playerid,BankTextDraws[playerid][2], 1);
- PlayerTextDrawBoxColor(playerid,BankTextDraws[playerid][2], 255);
- PlayerTextDrawTextSize(playerid,BankTextDraws[playerid][2], 423.000000, 0.000000);
- BankTextDraws[playerid][3] = CreatePlayerTextDraw(playerid,188.000000, 350.000000, "_"); //Line Down
- PlayerTextDrawBackgroundColor(playerid,BankTextDraws[playerid][3], 255);
- PlayerTextDrawFont(playerid,BankTextDraws[playerid][3], 1);
- PlayerTextDrawLetterSize(playerid,BankTextDraws[playerid][3], 0.500000, -0.399999);
- PlayerTextDrawColor(playerid,BankTextDraws[playerid][3], -1);
- PlayerTextDrawSetOutline(playerid,BankTextDraws[playerid][3], 0);
- PlayerTextDrawSetProportional(playerid,BankTextDraws[playerid][3], 1);
- PlayerTextDrawSetShadow(playerid,BankTextDraws[playerid][3], 1);
- PlayerTextDrawUseBox(playerid,BankTextDraws[playerid][3], 1);
- PlayerTextDrawBoxColor(playerid,BankTextDraws[playerid][3], 255);
- PlayerTextDrawTextSize(playerid,BankTextDraws[playerid][3], 423.000000, 0.000000);
- BankTextDraws[playerid][4] = CreatePlayerTextDraw(playerid,192.000000, 200.000000, "____MENU DO BANCO"); //Titulo
- PlayerTextDrawBackgroundColor(playerid,BankTextDraws[playerid][4], -1);
- PlayerTextDrawFont(playerid,BankTextDraws[playerid][4], 2);
- PlayerTextDrawLetterSize(playerid,BankTextDraws[playerid][4], 0.500000, 1.400000);
- PlayerTextDrawColor(playerid,BankTextDraws[playerid][4], -8388353);
- PlayerTextDrawSetOutline(playerid,BankTextDraws[playerid][4], 1);
- PlayerTextDrawSetProportional(playerid,BankTextDraws[playerid][4], 1);
- PlayerTextDrawUseBox(playerid,BankTextDraws[playerid][4], 1);
- PlayerTextDrawBoxColor(playerid,BankTextDraws[playerid][4], 255);
- PlayerTextDrawTextSize(playerid,BankTextDraws[playerid][4], 419.000000, 0.000000);
- BankTextDraws[playerid][5] = CreatePlayerTextDraw(playerid,195.000000, 223.000000, "_______ABRIR CONTA");
- PlayerTextDrawBackgroundColor(playerid,BankTextDraws[playerid][5], 255);
- PlayerTextDrawFont(playerid,BankTextDraws[playerid][5], 2);
- PlayerTextDrawLetterSize(playerid,BankTextDraws[playerid][5], 0.500000, 1.300000);
- PlayerTextDrawColor(playerid,BankTextDraws[playerid][5], -1);
- PlayerTextDrawSetOutline(playerid,BankTextDraws[playerid][5], 0);
- PlayerTextDrawSetProportional(playerid,BankTextDraws[playerid][5], 1);
- PlayerTextDrawSetShadow(playerid,BankTextDraws[playerid][5], 1);
- PlayerTextDrawUseBox(playerid,BankTextDraws[playerid][5], 1);
- PlayerTextDrawBoxColor(playerid,BankTextDraws[playerid][5], 255);
- PlayerTextDrawTextSize(playerid,BankTextDraws[playerid][5], 416.000000, 10.000000);
- BankTextDraws[playerid][6] = CreatePlayerTextDraw(playerid,195.000000, 244.000000, "_________DEPOSITAR");
- PlayerTextDrawBackgroundColor(playerid,BankTextDraws[playerid][6], 255);
- PlayerTextDrawFont(playerid,BankTextDraws[playerid][6], 2);
- PlayerTextDrawLetterSize(playerid,BankTextDraws[playerid][6], 0.500000, 1.300000);
- PlayerTextDrawColor(playerid,BankTextDraws[playerid][6], -1);
- PlayerTextDrawSetOutline(playerid,BankTextDraws[playerid][6], 0);
- PlayerTextDrawSetProportional(playerid,BankTextDraws[playerid][6], 1);
- PlayerTextDrawSetShadow(playerid,BankTextDraws[playerid][6], 1);
- PlayerTextDrawUseBox(playerid,BankTextDraws[playerid][6], 1);
- PlayerTextDrawBoxColor(playerid,BankTextDraws[playerid][6], 255);
- PlayerTextDrawTextSize(playerid,BankTextDraws[playerid][6], 416.000000, 10.000000);
- BankTextDraws[playerid][7] = CreatePlayerTextDraw(playerid,195.000000, 265.000000, "_____________SACAR");
- PlayerTextDrawBackgroundColor(playerid,BankTextDraws[playerid][7], 255);
- PlayerTextDrawFont(playerid,BankTextDraws[playerid][7], 2);
- PlayerTextDrawLetterSize(playerid,BankTextDraws[playerid][7], 0.500000, 1.300000);
- PlayerTextDrawColor(playerid,BankTextDraws[playerid][7], -1);
- PlayerTextDrawSetOutline(playerid,BankTextDraws[playerid][7], 0);
- PlayerTextDrawSetProportional(playerid,BankTextDraws[playerid][7], 1);
- PlayerTextDrawSetShadow(playerid,BankTextDraws[playerid][7], 1);
- PlayerTextDrawUseBox(playerid,BankTextDraws[playerid][7], 1);
- PlayerTextDrawBoxColor(playerid,BankTextDraws[playerid][7], 255);
- PlayerTextDrawTextSize(playerid,BankTextDraws[playerid][7], 416.000000, 10.000000);
- BankTextDraws[playerid][8] = CreatePlayerTextDraw(playerid,195.000000, 286.000000, "_____________SALDO");
- PlayerTextDrawBackgroundColor(playerid,BankTextDraws[playerid][8], 255);
- PlayerTextDrawFont(playerid,BankTextDraws[playerid][8], 2);
- PlayerTextDrawLetterSize(playerid,BankTextDraws[playerid][8], 0.500000, 1.300000);
- PlayerTextDrawColor(playerid,BankTextDraws[playerid][8], -1);
- PlayerTextDrawSetOutline(playerid,BankTextDraws[playerid][8], 0);
- PlayerTextDrawSetProportional(playerid,BankTextDraws[playerid][8], 1);
- PlayerTextDrawSetShadow(playerid,BankTextDraws[playerid][8], 1);
- PlayerTextDrawUseBox(playerid,BankTextDraws[playerid][8], 1);
- PlayerTextDrawBoxColor(playerid,BankTextDraws[playerid][8], 255);
- PlayerTextDrawTextSize(playerid,BankTextDraws[playerid][8], 416.000000, 10.000000);
- BankTextDraws[playerid][9] = CreatePlayerTextDraw(playerid,195.000000, 307.000000, "______MUDAR SENHA");
- PlayerTextDrawBackgroundColor(playerid,BankTextDraws[playerid][9], 255);
- PlayerTextDrawFont(playerid,BankTextDraws[playerid][9], 2);
- PlayerTextDrawLetterSize(playerid,BankTextDraws[playerid][9], 0.500000, 1.300000);
- PlayerTextDrawColor(playerid,BankTextDraws[playerid][9], -1);
- PlayerTextDrawSetOutline(playerid,BankTextDraws[playerid][9], 0);
- PlayerTextDrawSetProportional(playerid,BankTextDraws[playerid][9], 1);
- PlayerTextDrawSetShadow(playerid,BankTextDraws[playerid][9], 1);
- PlayerTextDrawUseBox(playerid,BankTextDraws[playerid][9], 1);
- PlayerTextDrawBoxColor(playerid,BankTextDraws[playerid][9], 255);
- PlayerTextDrawTextSize(playerid,BankTextDraws[playerid][9], 416.000000, 10.000000);
- BankTextDraws[playerid][10] = CreatePlayerTextDraw(playerid,195.000000, 328.000000, "_________CANCELAR");
- PlayerTextDrawBackgroundColor(playerid,BankTextDraws[playerid][10], 255);
- PlayerTextDrawFont(playerid,BankTextDraws[playerid][10], 2);
- PlayerTextDrawLetterSize(playerid,BankTextDraws[playerid][10], 0.500000, 1.300000);
- PlayerTextDrawColor(playerid,BankTextDraws[playerid][10], -16776961);
- PlayerTextDrawSetOutline(playerid,BankTextDraws[playerid][10], 0);
- PlayerTextDrawSetProportional(playerid,BankTextDraws[playerid][10], 1);
- PlayerTextDrawSetShadow(playerid,BankTextDraws[playerid][10], 1);
- PlayerTextDrawUseBox(playerid,BankTextDraws[playerid][10], 1);
- PlayerTextDrawBoxColor(playerid,BankTextDraws[playerid][10], 255);
- PlayerTextDrawTextSize(playerid,BankTextDraws[playerid][10], 416.000000, 10.000000);
- //-- PlayerClick --
- BankTDClick[playerid][0] = CreatePlayerTextDraw(playerid,192.000000, 220.000000, "_"); //Fundo
- PlayerTextDrawBackgroundColor(playerid,BankTDClick[playerid][0], 255);
- PlayerTextDrawFont(playerid,BankTDClick[playerid][0], 1);
- PlayerTextDrawLetterSize(playerid,BankTDClick[playerid][0], 0.500000, 13.700000);
- PlayerTextDrawColor(playerid,BankTDClick[playerid][0], -1);
- PlayerTextDrawSetOutline(playerid,BankTDClick[playerid][0], 0);
- PlayerTextDrawSetProportional(playerid,BankTDClick[playerid][0], 1);
- PlayerTextDrawSetShadow(playerid,BankTDClick[playerid][0], 1);
- PlayerTextDrawUseBox(playerid,BankTDClick[playerid][0], 1);
- PlayerTextDrawBoxColor(playerid,BankTDClick[playerid][0], -8388353);
- PlayerTextDrawTextSize(playerid,BankTDClick[playerid][0], 419.000000, 0.000000);
- BankTDClick[playerid][1] = CreatePlayerTextDraw(playerid,188.000000, 200.000000, "_"); //Line Left
- PlayerTextDrawBackgroundColor(playerid,BankTDClick[playerid][1], 255);
- PlayerTextDrawFont(playerid,BankTDClick[playerid][1], 1);
- PlayerTextDrawLetterSize(playerid,BankTDClick[playerid][1], 0.500000, 15.800001);
- PlayerTextDrawColor(playerid,BankTDClick[playerid][1], -1);
- PlayerTextDrawSetOutline(playerid,BankTDClick[playerid][1], 0);
- PlayerTextDrawSetProportional(playerid,BankTDClick[playerid][1], 1);
- PlayerTextDrawSetShadow(playerid,BankTDClick[playerid][1], 1);
- PlayerTextDrawUseBox(playerid,BankTDClick[playerid][1], 1);
- PlayerTextDrawBoxColor(playerid,BankTDClick[playerid][1], 255);
- PlayerTextDrawTextSize(playerid,BankTDClick[playerid][1], 184.000000, 0.000000);
- BankTDClick[playerid][2] = CreatePlayerTextDraw(playerid,427.000000, 200.000000, "_"); //Line Right
- PlayerTextDrawBackgroundColor(playerid,BankTDClick[playerid][2], 255);
- PlayerTextDrawFont(playerid,BankTDClick[playerid][2], 1);
- PlayerTextDrawLetterSize(playerid,BankTDClick[playerid][2], 0.500000, 15.800004);
- PlayerTextDrawColor(playerid,BankTDClick[playerid][2], -1);
- PlayerTextDrawSetOutline(playerid,BankTDClick[playerid][2], 0);
- PlayerTextDrawSetProportional(playerid,BankTDClick[playerid][2], 1);
- PlayerTextDrawSetShadow(playerid,BankTDClick[playerid][2], 1);
- PlayerTextDrawUseBox(playerid,BankTDClick[playerid][2], 1);
- PlayerTextDrawBoxColor(playerid,BankTDClick[playerid][2], 255);
- PlayerTextDrawTextSize(playerid,BankTDClick[playerid][2], 423.000000, 0.000000);
- BankTDClick[playerid][3] = CreatePlayerTextDraw(playerid,188.000000, 350.000000, "_"); //Line Down
- PlayerTextDrawBackgroundColor(playerid,BankTDClick[playerid][3], 255);
- PlayerTextDrawFont(playerid,BankTDClick[playerid][3], 1);
- PlayerTextDrawLetterSize(playerid,BankTDClick[playerid][3], 0.500000, -0.399999);
- PlayerTextDrawColor(playerid,BankTDClick[playerid][3], -1);
- PlayerTextDrawSetOutline(playerid,BankTDClick[playerid][3], 0);
- PlayerTextDrawSetProportional(playerid,BankTDClick[playerid][3], 1);
- PlayerTextDrawSetShadow(playerid,BankTDClick[playerid][3], 1);
- PlayerTextDrawUseBox(playerid,BankTDClick[playerid][3], 1);
- PlayerTextDrawBoxColor(playerid,BankTDClick[playerid][3], 255);
- PlayerTextDrawTextSize(playerid,BankTDClick[playerid][3], 423.000000, 0.000000);
- BankTDClick[playerid][4] = CreatePlayerTextDraw(playerid,192.000000, 200.000000, "-"); //Titulo
- PlayerTextDrawBackgroundColor(playerid,BankTDClick[playerid][4], -65281);
- PlayerTextDrawFont(playerid,BankTDClick[playerid][4], 2);
- PlayerTextDrawLetterSize(playerid,BankTDClick[playerid][4], 0.500000, 1.400000);
- PlayerTextDrawColor(playerid,BankTDClick[playerid][4], 255);
- PlayerTextDrawSetOutline(playerid,BankTDClick[playerid][4], 1);
- PlayerTextDrawSetProportional(playerid,BankTDClick[playerid][4], 1);
- PlayerTextDrawUseBox(playerid,BankTDClick[playerid][4], 1);
- PlayerTextDrawBoxColor(playerid,BankTDClick[playerid][4], 255);
- PlayerTextDrawTextSize(playerid,BankTDClick[playerid][4], 419.000000, 0.000000);
- BankTDClick[playerid][5] = CreatePlayerTextDraw(playerid,195.000000, 223.000000, "_SALDO DO JOGADOR");
- PlayerTextDrawBackgroundColor(playerid,BankTDClick[playerid][5], 255);
- PlayerTextDrawFont(playerid,BankTDClick[playerid][5], 2);
- PlayerTextDrawLetterSize(playerid,BankTDClick[playerid][5], 0.500000, 1.300000);
- PlayerTextDrawColor(playerid,BankTDClick[playerid][5], -1);
- PlayerTextDrawSetOutline(playerid,BankTDClick[playerid][5], 0);
- PlayerTextDrawSetProportional(playerid,BankTDClick[playerid][5], 1);
- PlayerTextDrawSetShadow(playerid,BankTDClick[playerid][5], 1);
- PlayerTextDrawUseBox(playerid,BankTDClick[playerid][5], 1);
- PlayerTextDrawBoxColor(playerid,BankTDClick[playerid][5], 255);
- PlayerTextDrawTextSize(playerid,BankTDClick[playerid][5], 416.000000, 10.000000);
- BankTDClick[playerid][6] = CreatePlayerTextDraw(playerid,195.000000, 244.000000, "________TRANSFERIR");
- PlayerTextDrawBackgroundColor(playerid,BankTDClick[playerid][6], 255);
- PlayerTextDrawFont(playerid,BankTDClick[playerid][6], 2);
- PlayerTextDrawLetterSize(playerid,BankTDClick[playerid][6], 0.500000, 1.300000);
- PlayerTextDrawColor(playerid,BankTDClick[playerid][6], -1);
- PlayerTextDrawSetOutline(playerid,BankTDClick[playerid][6], 0);
- PlayerTextDrawSetProportional(playerid,BankTDClick[playerid][6], 1);
- PlayerTextDrawSetShadow(playerid,BankTDClick[playerid][6], 1);
- PlayerTextDrawUseBox(playerid,BankTDClick[playerid][6], 1);
- PlayerTextDrawBoxColor(playerid,BankTDClick[playerid][6], 255);
- PlayerTextDrawTextSize(playerid,BankTDClick[playerid][6], 416.000000, 10.000000);
- BankTDClick[playerid][7] = CreatePlayerTextDraw(playerid,195.000000, 265.000000, "_______SETAR SALDO");
- PlayerTextDrawBackgroundColor(playerid,BankTDClick[playerid][7], 255);
- PlayerTextDrawFont(playerid,BankTDClick[playerid][7], 2);
- PlayerTextDrawLetterSize(playerid,BankTDClick[playerid][7], 0.500000, 1.300000);
- PlayerTextDrawColor(playerid,BankTDClick[playerid][7], -1);
- PlayerTextDrawSetOutline(playerid,BankTDClick[playerid][7], 0);
- PlayerTextDrawSetProportional(playerid,BankTDClick[playerid][7], 1);
- PlayerTextDrawSetShadow(playerid,BankTDClick[playerid][7], 1);
- PlayerTextDrawUseBox(playerid,BankTDClick[playerid][7], 1);
- PlayerTextDrawBoxColor(playerid,BankTDClick[playerid][7], 255);
- PlayerTextDrawTextSize(playerid,BankTDClick[playerid][7], 416.000000, 10.000000);
- BankTDClick[playerid][8] = CreatePlayerTextDraw(playerid,195.000000, 286.000000, "_____RESETAR CONTA");
- PlayerTextDrawBackgroundColor(playerid,BankTDClick[playerid][8], 255);
- PlayerTextDrawFont(playerid,BankTDClick[playerid][8], 2);
- PlayerTextDrawLetterSize(playerid,BankTDClick[playerid][8], 0.500000, 1.300000);
- PlayerTextDrawColor(playerid,BankTDClick[playerid][8], -1);
- PlayerTextDrawSetOutline(playerid,BankTDClick[playerid][8], 0);
- PlayerTextDrawSetProportional(playerid,BankTDClick[playerid][8], 1);
- PlayerTextDrawSetShadow(playerid,BankTDClick[playerid][8], 1);
- PlayerTextDrawUseBox(playerid,BankTDClick[playerid][8], 1);
- PlayerTextDrawBoxColor(playerid,BankTDClick[playerid][8], 255);
- PlayerTextDrawTextSize(playerid,BankTDClick[playerid][8], 416.000000, 10.000000);
- BankTDClick[playerid][9] = CreatePlayerTextDraw(playerid,195.000000, 307.000000, "__INFOS DO JOGADOR");
- PlayerTextDrawBackgroundColor(playerid,BankTDClick[playerid][9], 255);
- PlayerTextDrawFont(playerid,BankTDClick[playerid][9], 2);
- PlayerTextDrawLetterSize(playerid,BankTDClick[playerid][9], 0.500000, 1.300000);
- PlayerTextDrawColor(playerid,BankTDClick[playerid][9], -1);
- PlayerTextDrawSetOutline(playerid,BankTDClick[playerid][9], 0);
- PlayerTextDrawSetProportional(playerid,BankTDClick[playerid][9], 1);
- PlayerTextDrawSetShadow(playerid,BankTDClick[playerid][9], 1);
- PlayerTextDrawUseBox(playerid,BankTDClick[playerid][9], 1);
- PlayerTextDrawBoxColor(playerid,BankTDClick[playerid][9], 255);
- PlayerTextDrawTextSize(playerid,BankTDClick[playerid][9], 416.000000, 10.000000);
- BankTDClick[playerid][10] = CreatePlayerTextDraw(playerid,195.000000, 328.000000, "_________CANCELAR");
- PlayerTextDrawBackgroundColor(playerid,BankTDClick[playerid][10], 255);
- PlayerTextDrawFont(playerid,BankTDClick[playerid][10], 2);
- PlayerTextDrawLetterSize(playerid,BankTDClick[playerid][10], 0.500000, 1.300000);
- PlayerTextDrawColor(playerid,BankTDClick[playerid][10], -16776961);
- PlayerTextDrawSetOutline(playerid,BankTDClick[playerid][10], 0);
- PlayerTextDrawSetProportional(playerid,BankTDClick[playerid][10], 1);
- PlayerTextDrawSetShadow(playerid,BankTDClick[playerid][10], 1);
- PlayerTextDrawUseBox(playerid,BankTDClick[playerid][10], 1);
- PlayerTextDrawBoxColor(playerid,BankTDClick[playerid][10], 255);
- PlayerTextDrawTextSize(playerid,BankTDClick[playerid][10], 416.000000, 10.000000);
- Bank[playerid][EntrouConta] = false;
- Bank[playerid][ChancesEnter] = 0;
- Bank[playerid][pClicked] = -99999;
- if(DOF2_FileExists(pBank(playerid)))
- {
- Bank[playerid][Saldo] = DOF2_GetInt(pBank(playerid), "Saldo");
- Bank[playerid][CriouConta] = DOF2_GetBool(pBank(playerid), "ContaCriada");
- Bank[playerid][LastDeposito] = DOF2_GetInt(pBank(playerid), "LastDeposito");
- Bank[playerid][LastSaldo] = DOF2_GetInt(pBank(playerid), "LastSaque");
- Bank[playerid][LastTransferido] = DOF2_GetInt(pBank(playerid), "LastTransferido");
- }
- return 1;
- }
- public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
- {
- new xMoney = GetPlayerMoney(playerid), StringPCPT[256];
- if(_:playertextid == INVALID_TEXT_DRAW) return CallLocalFunction("OnPlayerClickPlayerTextDraw", "ii", playerid, INVALID_TEXT_DRAW);
- else if(playertextid == BankTextDraws[playerid][5]) //Abrir Conta | Entrar Conta
- {
- if(Bank[playerid][CriouConta] == true)
- {
- if(Bank[playerid][EntrouConta] == false)
- {
- OpenDialogBank(playerid, 2);
- ShowTDBank(playerid, false);
- }
- else return ShowTDBank(playerid, false);
- }
- else
- {
- if(xMoney >= MONEY_CURRENT)
- {
- OpenDialogBank(playerid, 1);
- ShowTDBank(playerid, false);
- }
- else
- {
- format(StringPCPT, sizeof(StringPCPT), "{FF2424}[ERRO]: Você precisa de {00FF00}R$ %d {FF2424}para criar sua conta bancária.", MONEY_CURRENT);
- SendClientMessage(playerid, -1, StringPCPT);
- ShowTDBank(playerid, false);
- }
- }
- }
- else if(playertextid == BankTextDraws[playerid][6]) //Depositar
- {
- if(Bank[playerid][EntrouConta] == false) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não entrou em sua conta bancária.");
- OpenDialogBank(playerid, 3);
- ShowTDBank(playerid, false);
- }
- else if(playertextid == BankTextDraws[playerid][7]) //Sacar
- {
- if(Bank[playerid][EntrouConta] == false) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não entrou em sua conta bancária.");
- OpenDialogBank(playerid, 4);
- ShowTDBank(playerid, false);
- }
- else if(playertextid == BankTextDraws[playerid][8]) //Saldo
- {
- new DialogInfuor[800];
- if(Bank[playerid][EntrouConta] == false) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não entrou em sua conta bancária.");
- strcatEx(StringPCPT, DialogInfuor, "\n{FF8000}=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[ {FFFF00}SALDO {FF8000}]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n", 0);
- strcatEx(StringPCPT, DialogInfuor, "{00FFFF}Último valor sacado: {00FF00}R$ %d{00FFFF}.\n", Bank[playerid][LastSaldo]);
- strcatEx(StringPCPT, DialogInfuor, "{00FFFF}Último valor depositado: {00FF00}R$ %d{00FFFF}.\n", Bank[playerid][LastDeposito]);
- strcatEx(StringPCPT, DialogInfuor, "{00FFFF}Último valor transferido: {00FF00}R$ %d{00FFFF}.\n", Bank[playerid][LastTransferido]);
- strcatEx(StringPCPT, DialogInfuor, "{00FFFF}Saldo atual: {00FF00}R$ %d{00FFFF}.\n", Bank[playerid][Saldo]);
- strcatEx(StringPCPT, DialogInfuor, "{FF8000}=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[ {FFFF00}SALDO {FF8000}]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n", 0);
- ShowPlayerDialog(playerid, DIALOG_ALL_INFOS, DIALOG_STYLE_MSGBOX, "Saldo", DialogInfuor, "Ok", "");
- ShowTDBank(playerid, false);
- }
- else if(playertextid == BankTextDraws[playerid][9]) //Mudar Senha
- {
- if(Bank[playerid][EntrouConta] == false) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não entrou em sua conta bancária.");
- ShowTDBank(playerid, false);
- OpenDialogBank(playerid, 5);
- }
- else if(playertextid == BankTextDraws[playerid][10]) //Cancelar
- {
- ShowTDBank(playerid, false);
- }
- else if(playertextid == BankTDClick[playerid][5]) //[CLICK PLAYER] Saldo
- {
- new zClicked = Bank[playerid][pClicked], DialogInfuor[800];
- if(!IsPlayerConnected(zClicked)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Jogador não conectado.");
- strcatEx(StringPCPT, DialogInfuor, "\n{FF8000}=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[ {FFFF00}SALDO {FF8000}]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n", 0);
- strcatEx(StringPCPT, DialogInfuor, "{00FFFF}Jogador: {80FF80}%s [ID: %d]{00FFFF}.\n", xName(zClicked), zClicked);
- strcatEx(StringPCPT, DialogInfuor, "{00FFFF}Último valor sacado: {00FF00}R$ %d{00FFFF}.\n", Bank[zClicked][LastSaldo]);
- strcatEx(StringPCPT, DialogInfuor, "{00FFFF}Último valor depositado: {00FF00}R$ %d{00FFFF}.\n", Bank[zClicked][LastDeposito]);
- strcatEx(StringPCPT, DialogInfuor, "{00FFFF}Último valor transferido: {00FF00}R$ %d{00FFFF}.\n", Bank[zClicked][LastTransferido]);
- strcatEx(StringPCPT, DialogInfuor, "{00FFFF}Saldo atual: {00FF00}R$ %d{00FFFF}.\n", Bank[zClicked][Saldo]);
- strcatEx(StringPCPT, DialogInfuor, "{FF8000}=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[ {FFFF00}SALDO {FF8000}]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n", 0);
- ShowPlayerDialog(playerid, DIALOG_ALL_INFOS, DIALOG_STYLE_MSGBOX, "Saldo", DialogInfuor, "Ok", "");
- ShowTDBank(playerid, false, 1);
- }
- else if(playertextid == BankTDClick[playerid][6]) //[CLICK PLAYER] Transferir
- {
- if(!IsPlayerConnected(Bank[playerid][pClicked])) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Jogador não conectado.");
- OpenDialogBank(playerid, 6);
- ShowTDBank(playerid, false, 1);
- }
- else if(playertextid == BankTDClick[playerid][7]) //[CLICK PLAYER] Setar Saldo
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não tem autorização para usar este comando.");
- if(!IsPlayerConnected(Bank[playerid][pClicked])) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Jogador não conectado.");
- OpenDialogBank(playerid, 7);
- ShowTDBank(playerid, false, 1);
- }
- else if(playertextid == BankTDClick[playerid][8]) //[CLICK PLAYER] Resetar Conta
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não tem autorização para usar este comando.");
- if(!IsPlayerConnected(Bank[playerid][pClicked])) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Jogador não conectado.");
- OpenDialogBank(playerid, 8);
- ShowTDBank(playerid, false, 1);
- }
- else if(playertextid == BankTDClick[playerid][9]) //[CLICK PLAYER] Infos do Jogador
- {
- new qClicked = Bank[playerid][pClicked], StrDialogInfo[900], StrLabelDialog[128];
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não tem autorização para usar este comando.");
- if(!IsPlayerConnected(qClicked)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Jogador não conectado.");
- ShowTDBank(playerid, false, 1);
- if(Bank[qClicked][CriouConta])
- {
- strcatEx(StrLabelDialog, StrDialogInfo, "{8080FF}Nome de Usuário: {FFFF00}%s [ID: %d]\n", xName(qClicked), qClicked);
- if(Bank[playerid][EntrouConta]) strcat(StrDialogInfo, "{8080FF}Entrou na conta: {00FF00}Sim\n");
- else strcat(StrDialogInfo, "{8080FF}Entrou na conta: {FF0000}Não\n");
- strcatEx(StrLabelDialog, StrDialogInfo, "{8080FF}Último valor sacado: {00FF00}R$ %d\n", Bank[qClicked][LastSaldo]);
- strcatEx(StrLabelDialog, StrDialogInfo, "{8080FF}Último valor depositado: {00FF00}R$ %d\n", Bank[qClicked][LastDeposito]);
- strcatEx(StrLabelDialog, StrDialogInfo, "{8080FF}Último valor transferido: {00FF00}R$ %d\n", Bank[qClicked][LastTransferido]);
- strcatEx(StrLabelDialog, StrDialogInfo, "{8080FF}Saldo atual: {00FF00}R$ %d\n", Bank[qClicked][Saldo]);
- strcatEx(StrLabelDialog, StrDialogInfo, "{8080FF}Senha: {FF80FF}%s\n", DOF2_GetString(pBank(qClicked), "Senha"));
- ShowPlayerDialog(playerid, DIALOG_INFOS_PLAYER_CLK, DIALOG_STYLE_MSGBOX, "Informações do Jogador", StrDialogInfo, "Fechar", "");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_INFOS_PLAYER_CLK, DIALOG_STYLE_MSGBOX, "Informações do Jogador", "{FF2828}Este jogador não tem conta bancária.", "Fechar", "");
- }
- }
- else if(playertextid == BankTDClick[playerid][10]) //[CLICK PLAYER] Cancelar
- {
- ShowTDBank(playerid, false, 1);
- }
- return 0;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(DOF2_FileExists(pBank(playerid)) && Bank[playerid][CriouConta] == true)
- {
- DOF2_SetInt(pBank(playerid), "Saldo", Bank[playerid][Saldo]);
- DOF2_SetBool(pBank(playerid), "ContaCriada", Bank[playerid][CriouConta]);
- DOF2_SetInt(pBank(playerid), "LastDeposito", Bank[playerid][LastDeposito]);
- DOF2_SetInt(pBank(playerid), "LastSaque", Bank[playerid][LastSaldo]);
- DOF2_SetInt(pBank(playerid), "LastTransferido", Bank[playerid][LastTransferido]);
- }
- if(Bank[playerid][EntrouConta])
- {
- Bank[playerid][EntrouConta] = false;
- }
- Bank[playerid][ChancesEnter] = 0;
- Bank[playerid][pClicked] = -99999;
- return 1;
- }
- public OnPlayerSpawn(playerid) return ShowTDBank(playerid, false);
- public OnPlayerDeath(playerid, killerid, reason) return ShowTDBank(playerid, false);
- public KickInMsg(idp) return Kick(idp);
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new zMoney = GetPlayerMoney(playerid), StringDialogResponse[300];
- //Abrir Conta
- if(dialogid == DIALOG_OPEN_CONTA)
- {
- if(response)
- {
- if(zMoney < MONEY_CURRENT) return format(StringDialogResponse, sizeof(StringDialogResponse), "{FF2424}[ERRO]: Você precisa de {00FF00}R$ %d {FF2424}para criar sua conta bancária.", MONEY_CURRENT);
- if(strlen(inputtext) < MIN_CARACTERS || strlen(inputtext) > MAX_CARACTERS || !strlen(inputtext))
- {
- OpenDialogBank(playerid, 1);
- format(StringDialogResponse, sizeof(StringDialogResponse), "{FF0000}[ERRO]: A senha deve ter entre {00FF00}%d {FF0000}e {00FF00}%d {FF0000}caracteres!", MIN_CARACTERS, MAX_CARACTERS);
- SendClientMessage(playerid, -1, StringDialogResponse);
- return 1;
- }
- DOF2_CreateFile(pBank(playerid));
- DOF2_SetString(pBank(playerid), "Senha", inputtext);
- Bank[playerid][CriouConta] = true;
- Bank[playerid][Saldo] = MONEY_CURRENT;
- Bank[playerid][LastDeposito] = MONEY_CURRENT;
- Bank[playerid][LastSaldo] = 0;
- Bank[playerid][LastTransferido] = 0;
- GivePlayerMoney(playerid, -MONEY_CURRENT);
- format(StringDialogResponse, sizeof(StringDialogResponse), "{00FF00}[INFO]: Conta bancária criada com sucesso. Senha: {8080FF}%s", inputtext);
- SendClientMessage(playerid, -1, StringDialogResponse);
- ShowTDBank(playerid, true);
- }
- else return ShowTDBank(playerid, true);
- }
- //Entrar Conta
- if(dialogid == DIALOG_ENTER_CONTA)
- {
- if(response)
- {
- if(!strlen(inputtext)) return OpenDialogBank(playerid, 2);
- if(strcmp(inputtext, DOF2_GetString(pBank(playerid), "Senha"), true))
- {
- Bank[playerid][ChancesEnter]++;
- if(Bank[playerid][ChancesEnter] < CHANCES_ENTER)
- {
- SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Senha incorreta, tente novamente.");
- OpenDialogBank(playerid, 2);
- }
- else if(Bank[playerid][ChancesEnter] >= CHANCES_ENTER)
- {
- SendClientMessage(playerid, -1, "{FF0000}[INFO]: Você foi kickado por tentar entrar na conta bancária muitas vezes.");
- SetTimerEx("KickInMsg", 200, false, "i", playerid);
- }
- }
- else
- {
- Bank[playerid][EntrouConta] = true;
- SendClientMessage(playerid, 0x00FF00FF, "[INFO]: Você entrou em sua conta bancária com sucesso.");
- ShowTDBank(playerid, true);
- }
- }
- else return ShowTDBank(playerid, true);
- }
- //Depositar
- if(dialogid == DIALOG_DEPOSITAR_CONTA)
- {
- if(response)
- {
- new QuantDeposit = strval(inputtext);
- if(!QuantDeposit || strlen(inputtext) > 10)
- {
- SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Valor inválido.");
- OpenDialogBank(playerid, 3);
- return 1;
- }
- if(QuantDeposit > 10000000)
- {
- SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: O máximo permitido para deposito é {00FF00}R$ 10.000.000 {FF0000}(10 milhões).");
- OpenDialogBank(playerid, 3);
- return 1;
- }
- if(zMoney < QuantDeposit)
- {
- SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não tem esse dinheiro para depositar.");
- OpenDialogBank(playerid, 3);
- }
- else
- {
- new StrDialogResponse[800];
- Bank[playerid][LastDeposito] = Bank[playerid][Saldo];
- GivePlayerMoney(playerid, -QuantDeposit);
- Bank[playerid][Saldo] += QuantDeposit;
- strcatEx(StringDialogResponse, StrDialogResponse, "\n{FF8000}=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[ {FFFF00}DEPOSITO {FF8000}]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n", 0);
- strcatEx(StringDialogResponse, StrDialogResponse, "{00FFFF}Saldo anterior: {00FF00}R$ %d{00FFFF}.\n", Bank[playerid][LastDeposito]);
- strcatEx(StringDialogResponse, StrDialogResponse, "{00FFFF}Depositado: {00FF00}R$ %d{00FFFF}.\n", QuantDeposit);
- strcatEx(StringDialogResponse, StrDialogResponse, "{00FFFF}Novo saldo: {00FF00}R$ %d{00FFFF}.\n", Bank[playerid][Saldo]);
- strcatEx(StringDialogResponse, StrDialogResponse, "{FF8000}=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[ {FFFF00}DEPOSITO {FF8000}]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n", 0);
- ShowPlayerDialog(playerid, DIALOG_INFOS_PLAYER_CLK, DIALOG_STYLE_MSGBOX, "Deposito", StrDialogResponse, "Ok", "");
- ShowTDBank(playerid, true);
- Bank[playerid][LastDeposito] = QuantDeposit;
- }
- }
- else return ShowTDBank(playerid, true);
- }
- //Sacar
- if(dialogid == DIALOG_SACAR_CONTA)
- {
- if(response)
- {
- new QuantSak = strval(inputtext);
- if(!QuantSak || strlen(inputtext) > 10)
- {
- SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Valor inválido.");
- OpenDialogBank(playerid, 4);
- return 1;
- }
- if(QuantSak > 10000000)
- {
- SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: O máximo permitido para saque é {00FF00}R$ 10.000.000 {FF0000}(10 milhões).");
- OpenDialogBank(playerid, 4);
- return 1;
- }
- if(Bank[playerid][Saldo] < QuantSak)
- {
- SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não tem esse dinheiro em sua conta bancária.");
- OpenDialogBank(playerid, 4);
- }
- else
- {
- new BankStringForDialog[800];
- Bank[playerid][LastSaldo] = Bank[playerid][Saldo];
- GivePlayerMoney(playerid, QuantSak);
- Bank[playerid][Saldo] -= QuantSak;
- strcatEx(StringDialogResponse, BankStringForDialog, "\n{FF8000}=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[ {FFFF00}SAQUE {FF8000}]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n", 0);
- strcatEx(StringDialogResponse, BankStringForDialog, "{00FFFF}Saldo anterior: {00FF00}R$ %d{00FFFF}.\n", Bank[playerid][LastSaldo]);
- strcatEx(StringDialogResponse, BankStringForDialog, "{00FFFF}Sacado: {00FF00}R$ %d{00FFFF}.\n", QuantSak);
- strcatEx(StringDialogResponse, BankStringForDialog, "{00FFFF}Novo saldo: {00FF00}R$ %d{00FFFF}.\n", Bank[playerid][Saldo]);
- strcatEx(StringDialogResponse, BankStringForDialog, "{FF8000}=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[ {FFFF00}SAQUE {FF8000}]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n", 0);
- ShowPlayerDialog(playerid, DIALOG_INFOS_PLAYER_CLK, DIALOG_STYLE_MSGBOX, "Saque", BankStringForDialog, "Ok", "");
- ShowTDBank(playerid, true);
- Bank[playerid][LastSaldo] = QuantSak;
- }
- }
- else return ShowTDBank(playerid, true);
- }
- //Mudar Senha
- if(dialogid == DIALOG_MUDAR_SENHA)
- {
- if(response)
- {
- if(strlen(inputtext) < MIN_CARACTERS || strlen(inputtext) > MAX_CARACTERS || !strlen(inputtext))
- {
- OpenDialogBank(playerid, 5);
- format(StringDialogResponse, sizeof(StringDialogResponse), "{FF0000}[ERRO]: A senha deve ter entre {00FF00}%d {FF0000}e {00FF00}%d {FF0000}caracteres!", MIN_CARACTERS, MAX_CARACTERS);
- SendClientMessage(playerid, -1, StringDialogResponse);
- return 1;
- }
- DOF2_SetString(pBank(playerid), "Senha", inputtext);
- format(StringDialogResponse, sizeof(StringDialogResponse), "{FFFF00}[INFO]: Senha alterada com sucesso. Senha: {FF8000}%s{FFFF00}.", inputtext);
- SendClientMessage(playerid, -1, StringDialogResponse);
- ShowTDBank(playerid, true);
- }
- else return ShowTDBank(playerid, true);
- }
- //[CLICK PLAYER] Transferir
- if(dialogid == DIALOG_TRANSFERIR_CLICK)
- {
- new QuantTransfer = strval(inputtext);
- if(response)
- {
- new jClicked = Bank[playerid][pClicked];
- if(!IsPlayerConnected(jClicked)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: O jogador não está conectado.");
- if(!QuantTransfer || strlen(inputtext) > 10)
- {
- SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Valor inválido.");
- OpenDialogBank(playerid, 6);
- return 1;
- }
- if(QuantTransfer > 1000000)
- {
- SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: O máximo permitido para tranferir é {00FF00}R$ 1.000.000 {FF0000}(1 milhão).");
- OpenDialogBank(playerid, 6);
- return 1;
- }
- if(Bank[playerid][Saldo] < QuantTransfer)
- {
- SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não tem esse dinheiro em sua conta bancária.");
- OpenDialogBank(playerid, 6);
- }
- else
- {
- new DialogerStringZer[800];
- Bank[playerid][Saldo] -= QuantTransfer;
- Bank[jClicked][Saldo] += QuantTransfer;
- Bank[playerid][LastTransferido] = Bank[playerid][Saldo];
- strcatEx(StringDialogResponse, DialogerStringZer, "\n{FF8000}=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[ {FFFF00}TRANSFERÊNCIA {FF8000}]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n", 0);
- strcatEx(StringDialogResponse, DialogerStringZer, "{00FFFF}Saldo anterior: {00FF00}R$ %d{00FFFF}.\n", Bank[playerid][LastTransferido]);
- strcatEx(StringDialogResponse, DialogerStringZer, "{00FFFF}Transferido: {00FF00}R$ %d{00FFFF}.\n", QuantTransfer);
- strcatEx(StringDialogResponse, DialogerStringZer, "{00FFFF}Novo saldo: {00FF00}R$ %d{00FFFF}.\n", Bank[playerid][Saldo]);
- strcatEx(StringDialogResponse, DialogerStringZer, "{FF8000}=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[ {FFFF00}TRANSFERÊNCIA {FF8000}]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n", 0);
- ShowPlayerDialog(playerid, DIALOG_INFOS_PLAYER_CLK, DIALOG_STYLE_MSGBOX, "Transferência", DialogerStringZer, "Ok", "");
- format(StringDialogResponse, sizeof(StringDialogResponse), "{00FFFF}[INFO]: Você transferiu {00FF00}R$ %d {00FFFF}da sua conta bancária para o jogador {FF8000}%s [ID: %d] {00FFFF}com sucesso.", QuantTransfer, xName(jClicked), jClicked);
- SendClientMessage(playerid, -1, StringDialogResponse);
- format(StringDialogResponse, sizeof(StringDialogResponse), "{00FFFF}[INFO]: O jogador {FF8000}%s [ID: %d] {00FFFF}transferiu para a sua conta bancária {00FF00}R$ %d{00FFFF}.", xName(playerid), playerid, QuantTransfer);
- SendClientMessage(jClicked, -1, StringDialogResponse);
- Bank[playerid][LastTransferido] = QuantTransfer;
- ShowTDBank(playerid, true, 1);
- }
- }
- else return ShowTDBank(playerid, true, 1);
- }
- //[CLICK PLAYER] Setar Saldo
- if(dialogid == DIALOG_SET_SALDO_CLICK)
- {
- if(response)
- {
- new QuantSet = strval(inputtext), xClicked = Bank[playerid][pClicked];
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Jogador não conectado.");
- if(!QuantSet || strlen(inputtext) > 10)
- {
- SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Valor inválido.");
- OpenDialogBank(playerid, 7);
- return 1;
- }
- if(QuantSet > 10000000)
- {
- SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: O máximo permitido para tranferir é {00FF00}R$ 10.000.000 {FF0000}(10 milhões).");
- OpenDialogBank(playerid, 7);
- return 1;
- }
- Bank[xClicked][Saldo] = QuantSet;
- Bank[xClicked][LastDeposito] = QuantSet;
- format(StringDialogResponse, sizeof(StringDialogResponse), "{00FFFF}[INFO]: O Admin {FF8000}%s [ID: %d] {00FFFF}setou o saldo de sua conta bancária para {00FF00}R$ %d{00FFFF}.", xName(playerid), playerid, QuantSet);
- SendClientMessage(xClicked, -1, StringDialogResponse);
- format(StringDialogResponse, sizeof(StringDialogResponse), "{00FF00}[INFO]: Saldo do jogador {00FFFF}%s [ID: %d] {00FF00}setado para {FFFF00}R$ %d {00FF00}com sucesso.", xName(xClicked), xClicked, QuantSet);
- SendClientMessage(playerid, -1, StringDialogResponse);
- ShowTDBank(playerid, true, 1);
- }
- else return ShowTDBank(playerid, true, 1);
- }
- if(dialogid == DIALOG_CONFIRM_RESET)
- {
- if(response)
- {
- new nClicked = Bank[playerid][pClicked];
- if(!IsPlayerConnected(nClicked)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Jogador não conectado.");
- Bank[nClicked][Saldo] = 250;
- Bank[nClicked][LastDeposito] = 0;
- Bank[nClicked][LastTransferido] = 0;
- Bank[nClicked][LastSaldo] = 0;
- format(StringDialogResponse, sizeof(StringDialogResponse), "{FF8000}[ATENÇÃO]: O Admin {8080FF}%s [ID: %d] {FF8000}resetou sua conta bancária.", xName(playerid), playerid);
- SendClientMessage(nClicked, -1, StringDialogResponse);
- format(StringDialogResponse, sizeof(StringDialogResponse), "{00FF00}[INFO]: Conta bancária de {8080FF}%s [ID: %d] {00FF00}resetada com sucesso.", xName(nClicked), nClicked);
- SendClientMessage(playerid, -1, StringDialogResponse);
- }
- else return ShowTDBank(playerid, true, 1);
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- if(Bank[playerid][CriouConta] == false) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você precisa ter conta bancária para entrar no menu Bank Player. (/banco » Abrir Conta)");
- if(Bank[clickedplayerid][CriouConta] == false) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Este jogador não tem conta bancária.");
- Bank[playerid][pClicked] = clickedplayerid;
- ShowTDBank(playerid, true, 1);
- return 1;
- }
- CMD:banco(playerid)
- {
- ShowTDBank(playerid, true);
- return 1;
- }
- stock pBank(x)
- {
- new ArchiveBank[30], BankNameUser[MAX_PLAYER_NAME];
- GetPlayerName(x, BankNameUser, sizeof(BankNameUser));
- format(ArchiveBank, sizeof(ArchiveBank), PASTA_BANCO, BankNameUser);
- return ArchiveBank;
- }
- stock ShowTDBank(pID, bool:BoolShow, PrefixTD=0)
- {
- if(PrefixTD == 0)
- {
- if(BoolShow)
- {
- if(Bank[pID][CriouConta] == true) //Se o jogador tiver uma conta bancária, então...
- {
- PlayerTextDrawSetString(pID, BankTextDraws[pID][5], "______ENTRAR CONTA");
- }
- else //Se não...
- {
- PlayerTextDrawSetString(pID, BankTextDraws[pID][5], "_______ABRIR CONTA");
- }
- if(Bank[pID][EntrouConta] == true) //Se o jogador entrou na conta bancária...
- {
- //Mudar Senha = Habilitado
- PlayerTextDrawSetSelectable(pID, BankTextDraws[pID][9], true);
- PlayerTextDrawColor(pID, BankTextDraws[pID][9], -1);
- }
- else //Se não...
- {
- //Mudar Senha = Desabilitado
- PlayerTextDrawSetSelectable(pID, BankTextDraws[pID][9], false);
- PlayerTextDrawColor(pID, BankTextDraws[pID][9], 0x808080FF);
- }
- if(Bank[pID][Saldo] == 0 || Bank[pID][EntrouConta] == false) //Se o jogador tiver 0 de Saldo então...
- {
- //Sacar = Desabilitado
- PlayerTextDrawSetSelectable(pID, BankTextDraws[pID][7], false);
- PlayerTextDrawColor(pID, BankTextDraws[pID][7], 0x808080FF);
- }
- else //Se não...
- {
- //Sacar = Habilitado
- PlayerTextDrawSetSelectable(pID, BankTextDraws[pID][7], true);
- PlayerTextDrawColor(pID, BankTextDraws[pID][7], -1);
- }
- if(Bank[pID][EntrouConta] == true) //Se o jogador entrou na conta bancária...
- {
- PlayerTextDrawSetSelectable(pID, BankTextDraws[pID][5], false);
- PlayerTextDrawColor(pID, BankTextDraws[pID][5], 0x808080FF);
- PlayerTextDrawSetSelectable(pID, BankTextDraws[pID][6], true);
- PlayerTextDrawColor(pID, BankTextDraws[pID][6], -1);
- PlayerTextDrawSetSelectable(pID, BankTextDraws[pID][8], true);
- PlayerTextDrawColor(pID, BankTextDraws[pID][8], -1);
- }
- else //Se não...
- {
- PlayerTextDrawSetSelectable(pID, BankTextDraws[pID][5], true);
- PlayerTextDrawColor(pID, BankTextDraws[pID][5], -1);
- PlayerTextDrawSetSelectable(pID, BankTextDraws[pID][6], false);
- PlayerTextDrawColor(pID, BankTextDraws[pID][6], 0x808080FF);
- PlayerTextDrawSetSelectable(pID, BankTextDraws[pID][8], false);
- PlayerTextDrawColor(pID, BankTextDraws[pID][8], 0x808080FF);
- }
- PlayerTextDrawSetSelectable(pID, BankTextDraws[pID][10], true); //Cancelar = Habilitado
- for(new i = 0; i < 11; ++i) //Loop Simples
- {
- PlayerTextDrawShow(pID, BankTextDraws[pID][i]);
- }
- SelectTextDraw(pID, 0xFFFF00FF);
- }
- else
- {
- for(new i = 0; i < 11; ++i)
- {
- PlayerTextDrawHide(pID, BankTextDraws[pID][i]);
- }
- CancelSelectTextDraw(pID);
- }
- }
- else if(PrefixTD == 1)
- {
- new StrBankXvideos[128];
- if(BoolShow)
- {
- format(StrBankXvideos, sizeof(StrBankXvideos), "~>~ %s", xName(Bank[pID][pClicked]));
- PlayerTextDrawSetString(pID, BankTDClick[pID][4], StrBankXvideos);
- PlayerTextDrawSetSelectable(pID, BankTDClick[pID][5], true); //Saldo do Jogador = Habilitado
- PlayerTextDrawSetSelectable(pID, BankTDClick[pID][10], true); //Cancelar = Habilitado
- if(Bank[pID][pClicked] == pID)
- {
- PlayerTextDrawSetSelectable(pID, BankTDClick[pID][6], false);
- PlayerTextDrawColor(pID, BankTDClick[pID][6], 0x808080FF); //Transferir = Desabilitado
- }
- else
- {
- PlayerTextDrawSetSelectable(pID, BankTDClick[pID][6], true);
- PlayerTextDrawColor(pID, BankTDClick[pID][6], -1); //Transferir = Habilitado
- }
- if(IsPlayerAdmin(pID)) //Se o jogador for admin logado na Rcon...
- {
- PlayerTextDrawSetSelectable(pID, BankTDClick[pID][7], true); //Setar Saldo
- PlayerTextDrawSetSelectable(pID, BankTDClick[pID][8], true); //Resetar Conta
- PlayerTextDrawSetSelectable(pID, BankTDClick[pID][9], true); //Infos do Jogador
- PlayerTextDrawColor(pID, BankTDClick[pID][7], -1); //Setar Saldo = Habilitado
- PlayerTextDrawColor(pID, BankTDClick[pID][8], -1); //Resetar Conta = Habilitado
- PlayerTextDrawColor(pID, BankTDClick[pID][9], -1); //Infos do Jogador = Habilitado
- }
- else //Se não...
- {
- PlayerTextDrawSetSelectable(pID, BankTDClick[pID][7], false); //Setar Saldo
- PlayerTextDrawSetSelectable(pID, BankTDClick[pID][8], false); //Resetar Conta
- PlayerTextDrawSetSelectable(pID, BankTDClick[pID][9], false); //Infos do Jogador
- PlayerTextDrawColor(pID, BankTDClick[pID][7], 0x808080FF); //Setar Saldo = Desabilitado
- PlayerTextDrawColor(pID, BankTDClick[pID][8], 0x808080FF); //Resetar Conta = Desabilitado
- PlayerTextDrawColor(pID, BankTDClick[pID][9], 0x808080FF); //Infos do Jogador = Desabilitado
- }
- for(new i = 0; i < 11; ++i)
- {
- PlayerTextDrawShow(pID, BankTDClick[pID][i]);
- }
- SelectTextDraw(pID, 0xFFFF00FF);
- }
- else
- {
- for(new i = 0; i < 11; ++i)
- {
- PlayerTextDrawHide(pID, BankTDClick[pID][i]);
- }
- CancelSelectTextDraw(pID);
- }
- }
- return 1;
- }
- stock OpenDialogBank(xID, BankDialogID)
- {
- new BankDialogStr[400], pClickado = Bank[xID][pClicked];
- if(BankDialogID <= 0) return 0;
- switch(BankDialogID)
- {
- case 1: ShowPlayerDialog(xID, DIALOG_OPEN_CONTA, DIALOG_STYLE_INPUT, "Abrir Conta", "{8080FF}Digite a senha para criar sua conta bancária abaixo:", "Criar", "Cancelar");
- case 2: ShowPlayerDialog(xID, DIALOG_ENTER_CONTA, DIALOG_STYLE_INPUT, "Entrar", "{8080FF}Digite a senha para que você possa entrar em sua conta bancária.", "Entrar", "Cancelar");
- case 3: ShowPlayerDialog(xID, DIALOG_DEPOSITAR_CONTA, DIALOG_STYLE_INPUT, "Depositar", "{8080FF}Digite a quantidade de dinheiro que você quer depositar em sua conta bancária abaixo:", "Depositar", "Cancelar");
- case 4:
- {
- format(BankDialogStr, sizeof(BankDialogStr), "{8080FF}Saldo: {00FF00}R$ %d\n{8080FF}Digite a quantidade em dinheiro para sacar abaixo:", Bank[xID][Saldo]);
- ShowPlayerDialog(xID, DIALOG_SACAR_CONTA, DIALOG_STYLE_INPUT, "Sacar", BankDialogStr, "Sacar", "Cancelar");
- }
- case 5: ShowPlayerDialog(xID, DIALOG_MUDAR_SENHA, DIALOG_STYLE_INPUT, "Mudar senha bancária", "{8080FF}Digite a nova senha da conta bancária abaixo:", "Mudar", "Cancelar");
- case 6:
- {
- format(BankDialogStr, sizeof(BankDialogStr), "{8080FF}Seu saldo: {00FF00}R$ %d\n{8080FF}Digite o valor para transferir para a conta bancária do jogador {00CC00}%s [ID: %d] {8080FF}abaixo:", Bank[xID][Saldo], xName(pClickado), pClickado);
- ShowPlayerDialog(xID, DIALOG_TRANSFERIR_CLICK, DIALOG_STYLE_INPUT, "Transferir", BankDialogStr, "Confirmar", "Cancelar");
- }
- case 7:
- {
- format(BankDialogStr, sizeof(BankDialogStr), "{8080FF}Jogador: {FFFF00}%s [ID: %d]\n{8080FF}Saldo atual: {00FF00}R$ %d\n\n{8080FF}Digite a quantidade de dinheiro para setar o saldo do jogador abaixo:", xName(pClickado), pClickado, Bank[pClickado][Saldo]);
- ShowPlayerDialog(xID, DIALOG_SET_SALDO_CLICK, DIALOG_STYLE_INPUT, "Setar saldo", BankDialogStr, "Setar", "Cancelar");
- }
- case 8:
- {
- format(BankDialogStr, sizeof(BankDialogStr), "{8080FF}Tem certeza que quer resetar a conta do jogador {FFFF00}%s [ID: %d]{8080FF}?", xName(pClickado), pClickado);
- ShowPlayerDialog(xID, DIALOG_CONFIRM_RESET, DIALOG_STYLE_MSGBOX, "Resetar conta", BankDialogStr, "Resetar", "Cancelar");
- }
- }
- //Abrir Conta = 1 ||| Entrar Conta = 2 ||| Depositar = 3 ||| Sacar = 4 ||| Mudar Senha = 5 ||| Transferir = 6 ||| Setar Saldo = 7 ||| Resetar Conta = 8
- return 1;
- }
- stock xName(kID)
- {
- new RedTubeName[MAX_PLAYER_NAME];
- GetPlayerName(kID, RedTubeName, sizeof(RedTubeName));
- return RedTubeName;
- }
Add Comment
Please, Sign In to add comment