Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //SISTEMA CRIADO POR MATEUS_REIS
- //Não Esqueça de Criar pasta ContasBanco
- #define FILTERSCRIPT
- //---------------------INCLUDES--------------------//
- #include <a_samp>
- #include <zcmd>
- #include <dof2>
- #if defined FILTERSCRIPT
- //---------------------DEFINES--------------------//
- #define SacarCaixa 1
- #define TrasferirCaixa 2
- #define DepositarCaixa 3
- #define Dialog_acaboucaixa 4
- //-------------------VARIAVEIS-------------------//
- new Text:CaixaEco[17];
- enum BancoInfo
- {
- Dinheiro,
- Saldo
- }
- new bInfo[MAX_PLAYERS][BancoInfo];
- public OnFilterScriptInit()
- {
- print("\n-----------------------------------------------------------------------");
- print(" Mateus_Reis || Mateus_Reis || Mateus_Reis || Mateus_Reis || Mateus_Reis ");
- print(" Mateus_Reis || Sistema de Caixa-Economica[ELETRONICO] || Mateus_Reis ");
- print(" Mateus_Reis || Mateus_Reis || Mateus_Reis || Mateus_Reis || Mateus_Reis ");
- print("-----------------------------------------------------------------------\n");
- // Create the textdraws:
- CaixaEco[0] = TextDrawCreate(642.000000, 3.000000, "_");
- TextDrawBackgroundColor(CaixaEco[0], 255);
- TextDrawFont(CaixaEco[0], 1);
- TextDrawLetterSize(CaixaEco[0], 0.500000, 49.500000);
- TextDrawColor(CaixaEco[0], -1);
- TextDrawSetOutline(CaixaEco[0], 0);
- TextDrawSetProportional(CaixaEco[0], 1);
- TextDrawSetShadow(CaixaEco[0], 1);
- TextDrawUseBox(CaixaEco[0], 1);
- TextDrawBoxColor(CaixaEco[0], -1);
- TextDrawTextSize(CaixaEco[0], -2.000000, 0.000000);
- CaixaEco[1] = TextDrawCreate(634.000000, 10.000000, "_");
- TextDrawBackgroundColor(CaixaEco[1], 255);
- TextDrawFont(CaixaEco[1], 1);
- TextDrawLetterSize(CaixaEco[1], 0.500000, 47.499996);
- TextDrawColor(CaixaEco[1], -1);
- TextDrawSetOutline(CaixaEco[1], 0);
- TextDrawSetProportional(CaixaEco[1], 1);
- TextDrawSetShadow(CaixaEco[1], 1);
- TextDrawUseBox(CaixaEco[1], 1);
- TextDrawBoxColor(CaixaEco[1], 188);
- TextDrawTextSize(CaixaEco[1], 6.000000, 0.000000);
- CaixaEco[2] = TextDrawCreate(489.000000, 10.000000, "_");
- TextDrawBackgroundColor(CaixaEco[2], 255);
- TextDrawFont(CaixaEco[2], 1);
- TextDrawLetterSize(CaixaEco[2], 0.500000, 5.199999);
- TextDrawColor(CaixaEco[2], -1);
- TextDrawSetOutline(CaixaEco[2], 0);
- TextDrawSetProportional(CaixaEco[2], 1);
- TextDrawSetShadow(CaixaEco[2], 1);
- TextDrawUseBox(CaixaEco[2], 1);
- TextDrawBoxColor(CaixaEco[2], 51380);
- TextDrawTextSize(CaixaEco[2], 142.000000, 1.000000);
- CaixaEco[3] = TextDrawCreate(229.000000, 14.000000, "caixa economica");
- TextDrawBackgroundColor(CaixaEco[3], 255);
- TextDrawFont(CaixaEco[3], 3);
- TextDrawLetterSize(CaixaEco[3], 0.730000, 3.899999);
- TextDrawColor(CaixaEco[3], -1);
- TextDrawSetOutline(CaixaEco[3], 0);
- TextDrawSetProportional(CaixaEco[3], 1);
- TextDrawSetShadow(CaixaEco[3], 1);
- CaixaEco[4] = TextDrawCreate(211.000000, 112.000000, "_");
- TextDrawBackgroundColor(CaixaEco[4], 255);
- TextDrawFont(CaixaEco[4], 1);
- TextDrawLetterSize(CaixaEco[4], 0.500000, 5.199999);
- TextDrawColor(CaixaEco[4], -1);
- TextDrawSetOutline(CaixaEco[4], 0);
- TextDrawSetProportional(CaixaEco[4], 1);
- TextDrawSetShadow(CaixaEco[4], 1);
- TextDrawUseBox(CaixaEco[4], 1);
- TextDrawBoxColor(CaixaEco[4], 51380);
- TextDrawTextSize(CaixaEco[4], 6.000000, 1.000000);
- CaixaEco[5] = TextDrawCreate(634.000000, 112.000000, "_");
- TextDrawBackgroundColor(CaixaEco[5], 255);
- TextDrawFont(CaixaEco[5], 1);
- TextDrawLetterSize(CaixaEco[5], 0.500000, 5.199999);
- TextDrawColor(CaixaEco[5], -1);
- TextDrawSetOutline(CaixaEco[5], 0);
- TextDrawSetProportional(CaixaEco[5], 1);
- TextDrawSetShadow(CaixaEco[5], 1);
- TextDrawUseBox(CaixaEco[5], 1);
- TextDrawBoxColor(CaixaEco[5], 51380);
- TextDrawTextSize(CaixaEco[5], 430.000000, 1.000000);
- CaixaEco[6] = TextDrawCreate(211.000000, 205.000000, "_");
- TextDrawBackgroundColor(CaixaEco[6], 255);
- TextDrawFont(CaixaEco[6], 1);
- TextDrawLetterSize(CaixaEco[6], 0.500000, 5.199999);
- TextDrawColor(CaixaEco[6], -1);
- TextDrawSetOutline(CaixaEco[6], 0);
- TextDrawSetProportional(CaixaEco[6], 1);
- TextDrawSetShadow(CaixaEco[6], 1);
- TextDrawUseBox(CaixaEco[6], 1);
- TextDrawBoxColor(CaixaEco[6], 51380);
- TextDrawTextSize(CaixaEco[6], 6.000000, 1.000000);
- CaixaEco[7] = TextDrawCreate(634.000000, 205.000000, "_");
- TextDrawBackgroundColor(CaixaEco[7], 255);
- TextDrawFont(CaixaEco[7], 1);
- TextDrawLetterSize(CaixaEco[7], 0.500000, 5.199999);
- TextDrawColor(CaixaEco[7], -1);
- TextDrawSetOutline(CaixaEco[7], 0);
- TextDrawSetProportional(CaixaEco[7], 1);
- TextDrawSetShadow(CaixaEco[7], 1);
- TextDrawUseBox(CaixaEco[7], 1);
- TextDrawBoxColor(CaixaEco[7], 51380);
- TextDrawTextSize(CaixaEco[7], 430.000000, 1.000000);
- CaixaEco[8] = TextDrawCreate(634.000000, 307.000000, "_");
- TextDrawBackgroundColor(CaixaEco[8], 255);
- TextDrawFont(CaixaEco[8], 1);
- TextDrawLetterSize(CaixaEco[8], 0.500000, 5.199999);
- TextDrawColor(CaixaEco[8], -1);
- TextDrawSetOutline(CaixaEco[8], 0);
- TextDrawSetProportional(CaixaEco[8], 1);
- TextDrawSetShadow(CaixaEco[8], 1);
- TextDrawUseBox(CaixaEco[8], 1);
- TextDrawBoxColor(CaixaEco[8], 51380);
- TextDrawTextSize(CaixaEco[8], 430.000000, 1.000000);
- CaixaEco[9] = TextDrawCreate(211.000000, 307.000000, "_");
- TextDrawBackgroundColor(CaixaEco[9], 255);
- TextDrawFont(CaixaEco[9], 1);
- TextDrawLetterSize(CaixaEco[9], 0.500000, 5.199999);
- TextDrawColor(CaixaEco[9], -1);
- TextDrawSetOutline(CaixaEco[9], 0);
- TextDrawSetProportional(CaixaEco[9], 1);
- TextDrawSetShadow(CaixaEco[9], 1);
- TextDrawUseBox(CaixaEco[9], 1);
- TextDrawBoxColor(CaixaEco[9], 51380);
- TextDrawTextSize(CaixaEco[9], 6.000000, 1.000000);
- CaixaEco[10] = TextDrawCreate(65.000000, 122.000000, "Sacar");
- TextDrawBackgroundColor(CaixaEco[10], 255);
- TextDrawFont(CaixaEco[10], 3);
- TextDrawLetterSize(CaixaEco[10], 0.899999, 2.499999);
- TextDrawColor(CaixaEco[10], -1);
- TextDrawSetOutline(CaixaEco[10], 0);
- TextDrawSetProportional(CaixaEco[10], 1);
- TextDrawSetShadow(CaixaEco[10], 1);
- CaixaEco[11] = TextDrawCreate(28.000000, 215.000000, "transferir");
- TextDrawBackgroundColor(CaixaEco[11], 255);
- TextDrawFont(CaixaEco[11], 3);
- TextDrawLetterSize(CaixaEco[11], 0.899999, 2.499999);
- TextDrawColor(CaixaEco[11], -1);
- TextDrawSetOutline(CaixaEco[11], 0);
- TextDrawSetProportional(CaixaEco[11], 1);
- TextDrawSetShadow(CaixaEco[11], 1);
- CaixaEco[12] = TextDrawCreate(16.000000, 317.000000, "emprestimo");
- TextDrawBackgroundColor(CaixaEco[12], 255);
- TextDrawFont(CaixaEco[12], 3);
- TextDrawLetterSize(CaixaEco[12], 0.899999, 2.499999);
- TextDrawColor(CaixaEco[12], -1);
- TextDrawSetOutline(CaixaEco[12], 0);
- TextDrawSetProportional(CaixaEco[12], 1);
- TextDrawSetShadow(CaixaEco[12], 1);
- CaixaEco[13] = TextDrawCreate(504.000000, 317.000000, "/sairc");
- TextDrawBackgroundColor(CaixaEco[13], 255);
- TextDrawFont(CaixaEco[13], 3);
- TextDrawLetterSize(CaixaEco[13], 0.899999, 2.499999);
- TextDrawColor(CaixaEco[13], -1);
- TextDrawSetOutline(CaixaEco[13], 0);
- TextDrawSetProportional(CaixaEco[13], 1);
- TextDrawSetShadow(CaixaEco[13], 1);
- CaixaEco[14] = TextDrawCreate(461.000000, 215.000000, "depositar");
- TextDrawBackgroundColor(CaixaEco[14], 255);
- TextDrawFont(CaixaEco[14], 3);
- TextDrawLetterSize(CaixaEco[14], 0.899999, 2.499999);
- TextDrawColor(CaixaEco[14], -1);
- TextDrawSetOutline(CaixaEco[14], 0);
- TextDrawSetProportional(CaixaEco[14], 1);
- TextDrawSetShadow(CaixaEco[14], 1);
- CaixaEco[15] = TextDrawCreate(440.000000, 122.000000, "saldo conta");
- TextDrawBackgroundColor(CaixaEco[15], 255);
- TextDrawFont(CaixaEco[15], 3);
- TextDrawLetterSize(CaixaEco[15], 0.899999, 2.499999);
- TextDrawColor(CaixaEco[15], -1);
- TextDrawSetOutline(CaixaEco[15], 0);
- TextDrawSetProportional(CaixaEco[15], 1);
- TextDrawSetShadow(CaixaEco[15], 1);
- CaixaEco[16] = TextDrawCreate(146.000000, 419.000000, ">> www.brasilconectlogo.com <<");
- TextDrawBackgroundColor(CaixaEco[16], 255);
- TextDrawFont(CaixaEco[16], 2);
- TextDrawLetterSize(CaixaEco[16], 0.500000, 1.000000);
- TextDrawColor(CaixaEco[16], -1);
- TextDrawSetOutline(CaixaEco[16], 0);
- TextDrawSetProportional(CaixaEco[16], 1);
- TextDrawSetShadow(CaixaEco[16], 1);
- TextDrawSetSelectable(Text:CaixaEco[10], true);
- TextDrawSetSelectable(Text:CaixaEco[11], true);
- TextDrawSetSelectable(Text:CaixaEco[12], true);
- TextDrawSetSelectable(Text:CaixaEco[14], true);
- TextDrawSetSelectable(Text:CaixaEco[15], true);
- return 1;
- }
- public OnFilterScriptExit()
- {
- DOF2_Exit();
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- LoadCaixa(playerid);
- SendClientMessage(playerid, -1, " TUDO AQUI É UMA BASE PARA ADICIONAR AO SEU SERVE, BOA SORTE ABRAÇOS!!");
- SendClientMessage(playerid, -1, " TUDO AQUI É UMA BASE PARA ADICIONAR AO SEU SERVE, BOA SORTE ABRAÇOS!!");
- SendClientMessage(playerid, -1, " TUDO AQUI É UMA BASE PARA ADICIONAR AO SEU SERVE, BOA SORTE ABRAÇOS!!");
- SendClientMessage(playerid, -1, " TUDO AQUI É UMA BASE PARA ADICIONAR AO SEU SERVE, BOA SORTE ABRAÇOS!!");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- SalvarCaixa(playerid);
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == SacarCaixa)
- {
- if(!strval(inputtext)) return SendClientMessage(playerid, Rosa, "Operação inválida!");
- if(!response) return SendClientMessage(playerid, Cinza, "Você cancelou o opção.");
- else
- {
- if(strval(inputtext) >= bInfo[playerid][Saldo]) return SendClientMessage(playerid, Rosa, #Você não tem esse dinheiro todo no banco);
- {
- GivePlayerMoney(playerid, strval(inputtext));
- bInfo[playerid][Saldo] =- strval(inputtext);
- new string[120];
- format(string, sizeof(string), "Você sacou: R$: %d. Agora seu saldo é R$: %d",strval(inputtext), bInfo[playerid][Saldo]);
- SendClientMessage(playerid, Azul, string);
- }
- }
- }
- if(dialogid == DepositarCaixa)
- {
- if(!strval(inputtext)) return SendClientMessage(playerid, -1, "Operação inválida!");
- if(!response) return SendClientMessage(playerid, -1, "Você cancelou o opção.");
- else
- {
- if(bInfo[playerid][Dinheiro] >= strval(inputtext)) return SendClientMessage(playerid, -1, "Você não tem esse dinheiro");
- {
- bInfo[playerid][Saldo] += strval(inputtext);
- GivePlayerMoney(playerid, - strval(inputtext));
- new string[120];
- format(string, sizeof(string), "Você depositou: R$: %d. Agora seu saldo é R$: %d",strval(inputtext), bInfo[playerid][Saldo]);
- SendClientMessage(playerid, Azul, string);
- }
- }
- }
- new transferido[MAX_PLAYERS];
- if(dialogid == TrasferirCaixa)
- {
- if(!strval(inputtext)) return SendClientMessage(playerid, -1, "Operação inválida!");
- if(!response) return SendClientMessage(playerid, -1, "Você cancelou a opção");
- else
- {
- if(strval(inputtext) >= bInfo[playerid][Saldo]) return SendClientMessage(playerid, -1, "Você não tem esse dinheiro");
- {
- transferido[playerid] = strval(inputtext);
- ShowPlayerDialog(playerid, Dialog_acaboucaixa, DIALOG_STYLE_INPUT, "{0084FF}* Caixa Econômica *", "Digite o ID do player\nDigite apenas números", "Confirmar", "Cancelar");
- }
- }
- }
- if(dialogid == Dialog_acaboucaixa)
- {
- if(!strval(inputtext)) return SendClientMessage(playerid, -1, "Operação inválida!");
- if(!response) return SendClientMessage(playerid, -1, "Você cancelou a opção.");
- else
- {
- if(IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, -1, "Este jogador não está conectado");
- {
- bInfo[playerid][Saldo] =- transferido[playerid];
- bInfo[strval(inputtext)][Saldo] - transferido[playerid];
- new
- string[120],
- nome[25]
- ;
- GetPlayerName(strval(inputtext), nome, 25);
- format(string, sizeof(string), "Você transferiu: R$: %d. Para %s. Agora seu saldo é R$: %d",transferido[playerid], nome, bInfo[playerid][Saldo]);
- SendClientMessage(playerid, -1, string);
- PlayerPlaySound(playerid, 1130, 0.0, 0.0, 10.0);
- }
- }
- }
- return 1;
- }
- public OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- if(clickedid == CaixaEco[10])
- {
- new string[120];
- format(string, sizeof(string), "Escolha o valor da quantia para sacar.\nSeu saldo é R$: %d", bInfo[playerid][Saldo]);
- ShowPlayerDialog(playerid, SacarCaixa, DIALOG_STYLE_INPUT, "{0084FF}* Caixa Econômica *", string, "Confirmar", "Cancelar");
- }
- if(clickedid == CaixaEco[11])
- {
- new string[120];
- format(string, sizeof(string), "Escolha o valor da quantia a ser transferida.\nSeu saldo é R$: %d", bInfo[playerid][Saldo]);
- ShowPlayerDialog(playerid, TrasferirCaixa, DIALOG_STYLE_INPUT, "{0084FF}* Caixa Econômica *", string, "Confirmar", "Cancelar");
- }
- if(clickedid == CaixaEco[12])
- {
- GivePlayerMoney(playerid, 2000);
- SendClientMessage(playerid, -1, "Você pegou R$ 2.000,00");
- }
- if(clickedid == CaixaEco[14])
- {
- new string[120];
- format(string, sizeof(string), "Escolha o valor da quantia a ser depositada.\nSeu saldo é R$: %d", bInfo[playerid][Saldo]);
- ShowPlayerDialog(playerid, DepositarCaixa, DIALOG_STYLE_INPUT, "Banco Los Santos", string, "Confirmar", "Cancelar");
- }
- if(clickedid == CaixaEco[15])
- {
- new string[120];
- format(string, sizeof(string), "Seu saldo é R$: %d", bInfo[playerid][Saldo]);
- SendClientMessage(playerid, -1, string);
- return 1;
- }
- return 1;
- }
- CMD:caixa(playerid)
- {
- SelectTextDraw(playerid,0xE0FFFFFF);
- TextDrawShowForPlayer(playerid, CaixaEco[0]);
- TextDrawShowForPlayer(playerid, CaixaEco[1]);
- TextDrawShowForPlayer(playerid, CaixaEco[2]);
- TextDrawShowForPlayer(playerid, CaixaEco[3]);
- TextDrawShowForPlayer(playerid, CaixaEco[4]);
- TextDrawShowForPlayer(playerid, CaixaEco[5]);
- TextDrawShowForPlayer(playerid, CaixaEco[6]);
- TextDrawShowForPlayer(playerid, CaixaEco[7]);
- TextDrawShowForPlayer(playerid, CaixaEco[8]);
- TextDrawShowForPlayer(playerid, CaixaEco[9]);
- TextDrawShowForPlayer(playerid, CaixaEco[10]);
- TextDrawShowForPlayer(playerid, CaixaEco[11]);
- TextDrawShowForPlayer(playerid, CaixaEco[12]);
- TextDrawShowForPlayer(playerid, CaixaEco[13]);
- TextDrawShowForPlayer(playerid, CaixaEco[14]);
- TextDrawShowForPlayer(playerid, CaixaEco[15]);
- TextDrawShowForPlayer(playerid, CaixaEco[16]);
- return 1;
- }
- CMD:sairc(playerid)
- {
- CancelSelectTextDraw(playerid);
- //for(new i = 4; i < sizeof(CaixaEco); i++) { TextDrawHideForPlayer(playerid, CaixaEco[i]); }
- TextDrawHideForAll(CaixaEco[0]);//não mexer
- //TextDrawDestroy(CaixaEco[0]);
- TextDrawHideForAll(CaixaEco[1]);
- //TextDrawDestroy(CaixaEco[1]);
- TextDrawHideForAll(CaixaEco[2]);
- //TextDrawDestroy(CaixaEco[2]);
- TextDrawHideForAll(CaixaEco[3]);
- //TextDrawDestroy(CaixaEco[3]);
- TextDrawHideForAll(CaixaEco[4]);
- //TextDrawDestroy(CaixaEco[4]);
- TextDrawHideForAll(CaixaEco[5]);
- //TextDrawDestroy(CaixaEco[5]);
- TextDrawHideForAll(CaixaEco[6]);
- //TextDrawDestroy(CaixaEco[6]);
- TextDrawHideForAll(CaixaEco[7]);
- //TextDrawDestroy(CaixaEco[7]);
- TextDrawHideForAll(CaixaEco[8]);
- //TextDrawDestroy(CaixaEco[8]);
- TextDrawHideForAll(CaixaEco[9]);
- //TextDrawDestroy(CaixaEco[9]);
- TextDrawHideForAll(CaixaEco[10]);
- //TextDrawDestroy(CaixaEco[10]);
- TextDrawHideForAll(CaixaEco[11]);
- //TextDrawDestroy(CaixaEco[11]);
- TextDrawHideForAll(CaixaEco[12]);
- //TextDrawDestroy(CaixaEco[12]);
- TextDrawHideForAll(CaixaEco[13]);
- //TextDrawDestroy(CaixaEco[13]);
- TextDrawHideForAll(CaixaEco[14]);
- //TextDrawDestroy(CaixaEco[14]);
- TextDrawHideForAll(CaixaEco[15]);
- //TextDrawDestroy(CaixaEco[15]);
- TextDrawHideForAll(CaixaEco[16]);
- //TextDrawDestroy(CaixaEco[16]);
- return 1;
- }
- stock SalvarCaixa(playerid)
- {
- if(!DOF2_FileExists(Contas(playerid)))
- {
- DOF2_CreateFile(Contas(playerid));
- SalvarCaixa(playerid);
- return 1;
- }
- DOF2_SetInt(Contas(playerid),"Saldo", bInfo[playerid][Saldo] );
- DOF2_SetInt(Contas(playerid),"Dinheiro", bInfo[playerid][Dinheiro]);
- DOF2_SaveFile();
- return 1;
- }
- stock LoadCaixa(playerid)
- {
- bInfo[playerid][Saldo] = DOF2_GetInt(Contas(playerid), "Saldo");
- bInfo[playerid][Dinheiro] = DOF2_GetInt(Contas(playerid), "Dinheiro");
- return 1;
- }
- stock Contas(playerid)
- {
- new ArQ[50];
- format(ArQ, 50, "ContasBanco/%s.ini", pNome(playerid));
- return ArQ;
- }
- stock pNome(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment