Guest User

SISTEMA TELA BANCO MATEUS_REIS

a guest
Jan 29th, 2015
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 17.31 KB | None | 0 0
  1. //SISTEMA CRIADO POR MATEUS_REIS
  2. //Não Esqueça de Criar pasta ContasBanco
  3. #define FILTERSCRIPT
  4. //---------------------INCLUDES--------------------//
  5. #include    <a_samp>
  6. #include        <zcmd>
  7. #include        <dof2>
  8.  
  9. #if defined FILTERSCRIPT
  10. //---------------------DEFINES--------------------//
  11. #define SacarCaixa            1
  12. #define TrasferirCaixa        2
  13. #define DepositarCaixa        3
  14. #define Dialog_acaboucaixa    4
  15. //-------------------VARIAVEIS-------------------//
  16. new Text:CaixaEco[17];
  17.  
  18. enum BancoInfo
  19. {
  20.         Dinheiro,
  21.         Saldo
  22. }
  23. new bInfo[MAX_PLAYERS][BancoInfo];
  24.  
  25. public OnFilterScriptInit()
  26. {
  27.         print("\n-----------------------------------------------------------------------");
  28.     print(" Mateus_Reis || Mateus_Reis || Mateus_Reis || Mateus_Reis || Mateus_Reis ");
  29.     print(" Mateus_Reis ||   Sistema de Caixa-Economica[ELETRONICO]  || Mateus_Reis ");
  30.     print(" Mateus_Reis || Mateus_Reis || Mateus_Reis || Mateus_Reis || Mateus_Reis ");
  31.     print("-----------------------------------------------------------------------\n");
  32.    
  33.     // Create the textdraws:
  34.     CaixaEco[0] = TextDrawCreate(642.000000, 3.000000, "_");
  35.     TextDrawBackgroundColor(CaixaEco[0], 255);
  36.     TextDrawFont(CaixaEco[0], 1);
  37.     TextDrawLetterSize(CaixaEco[0], 0.500000, 49.500000);
  38.     TextDrawColor(CaixaEco[0], -1);
  39.     TextDrawSetOutline(CaixaEco[0], 0);
  40.     TextDrawSetProportional(CaixaEco[0], 1);
  41.     TextDrawSetShadow(CaixaEco[0], 1);
  42.     TextDrawUseBox(CaixaEco[0], 1);
  43.     TextDrawBoxColor(CaixaEco[0], -1);
  44.     TextDrawTextSize(CaixaEco[0], -2.000000, 0.000000);
  45.  
  46.     CaixaEco[1] = TextDrawCreate(634.000000, 10.000000, "_");
  47.     TextDrawBackgroundColor(CaixaEco[1], 255);
  48.     TextDrawFont(CaixaEco[1], 1);
  49.     TextDrawLetterSize(CaixaEco[1], 0.500000, 47.499996);
  50.     TextDrawColor(CaixaEco[1], -1);
  51.     TextDrawSetOutline(CaixaEco[1], 0);
  52.     TextDrawSetProportional(CaixaEco[1], 1);
  53.     TextDrawSetShadow(CaixaEco[1], 1);
  54.     TextDrawUseBox(CaixaEco[1], 1);
  55.     TextDrawBoxColor(CaixaEco[1], 188);
  56.     TextDrawTextSize(CaixaEco[1], 6.000000, 0.000000);
  57.  
  58.     CaixaEco[2] = TextDrawCreate(489.000000, 10.000000, "_");
  59.     TextDrawBackgroundColor(CaixaEco[2], 255);
  60.     TextDrawFont(CaixaEco[2], 1);
  61.     TextDrawLetterSize(CaixaEco[2], 0.500000, 5.199999);
  62.     TextDrawColor(CaixaEco[2], -1);
  63.     TextDrawSetOutline(CaixaEco[2], 0);
  64.     TextDrawSetProportional(CaixaEco[2], 1);
  65.     TextDrawSetShadow(CaixaEco[2], 1);
  66.     TextDrawUseBox(CaixaEco[2], 1);
  67.     TextDrawBoxColor(CaixaEco[2], 51380);
  68.     TextDrawTextSize(CaixaEco[2], 142.000000, 1.000000);
  69.  
  70.     CaixaEco[3] = TextDrawCreate(229.000000, 14.000000, "caixa economica");
  71.     TextDrawBackgroundColor(CaixaEco[3], 255);
  72.     TextDrawFont(CaixaEco[3], 3);
  73.     TextDrawLetterSize(CaixaEco[3], 0.730000, 3.899999);
  74.     TextDrawColor(CaixaEco[3], -1);
  75.     TextDrawSetOutline(CaixaEco[3], 0);
  76.     TextDrawSetProportional(CaixaEco[3], 1);
  77.     TextDrawSetShadow(CaixaEco[3], 1);
  78.  
  79.     CaixaEco[4] = TextDrawCreate(211.000000, 112.000000, "_");
  80.     TextDrawBackgroundColor(CaixaEco[4], 255);
  81.     TextDrawFont(CaixaEco[4], 1);
  82.     TextDrawLetterSize(CaixaEco[4], 0.500000, 5.199999);
  83.     TextDrawColor(CaixaEco[4], -1);
  84.     TextDrawSetOutline(CaixaEco[4], 0);
  85.     TextDrawSetProportional(CaixaEco[4], 1);
  86.     TextDrawSetShadow(CaixaEco[4], 1);
  87.     TextDrawUseBox(CaixaEco[4], 1);
  88.     TextDrawBoxColor(CaixaEco[4], 51380);
  89.     TextDrawTextSize(CaixaEco[4], 6.000000, 1.000000);
  90.  
  91.     CaixaEco[5] = TextDrawCreate(634.000000, 112.000000, "_");
  92.     TextDrawBackgroundColor(CaixaEco[5], 255);
  93.     TextDrawFont(CaixaEco[5], 1);
  94.     TextDrawLetterSize(CaixaEco[5], 0.500000, 5.199999);
  95.     TextDrawColor(CaixaEco[5], -1);
  96.     TextDrawSetOutline(CaixaEco[5], 0);
  97.     TextDrawSetProportional(CaixaEco[5], 1);
  98.     TextDrawSetShadow(CaixaEco[5], 1);
  99.     TextDrawUseBox(CaixaEco[5], 1);
  100.     TextDrawBoxColor(CaixaEco[5], 51380);
  101.     TextDrawTextSize(CaixaEco[5], 430.000000, 1.000000);
  102.  
  103.     CaixaEco[6] = TextDrawCreate(211.000000, 205.000000, "_");
  104.     TextDrawBackgroundColor(CaixaEco[6], 255);
  105.     TextDrawFont(CaixaEco[6], 1);
  106.     TextDrawLetterSize(CaixaEco[6], 0.500000, 5.199999);
  107.     TextDrawColor(CaixaEco[6], -1);
  108.     TextDrawSetOutline(CaixaEco[6], 0);
  109.     TextDrawSetProportional(CaixaEco[6], 1);
  110.     TextDrawSetShadow(CaixaEco[6], 1);
  111.     TextDrawUseBox(CaixaEco[6], 1);
  112.     TextDrawBoxColor(CaixaEco[6], 51380);
  113.     TextDrawTextSize(CaixaEco[6], 6.000000, 1.000000);
  114.  
  115.     CaixaEco[7] = TextDrawCreate(634.000000, 205.000000, "_");
  116.     TextDrawBackgroundColor(CaixaEco[7], 255);
  117.     TextDrawFont(CaixaEco[7], 1);
  118.     TextDrawLetterSize(CaixaEco[7], 0.500000, 5.199999);
  119.     TextDrawColor(CaixaEco[7], -1);
  120.     TextDrawSetOutline(CaixaEco[7], 0);
  121.     TextDrawSetProportional(CaixaEco[7], 1);
  122.     TextDrawSetShadow(CaixaEco[7], 1);
  123.     TextDrawUseBox(CaixaEco[7], 1);
  124.     TextDrawBoxColor(CaixaEco[7], 51380);
  125.     TextDrawTextSize(CaixaEco[7], 430.000000, 1.000000);
  126.  
  127.     CaixaEco[8] = TextDrawCreate(634.000000, 307.000000, "_");
  128.     TextDrawBackgroundColor(CaixaEco[8], 255);
  129.     TextDrawFont(CaixaEco[8], 1);
  130.     TextDrawLetterSize(CaixaEco[8], 0.500000, 5.199999);
  131.     TextDrawColor(CaixaEco[8], -1);
  132.     TextDrawSetOutline(CaixaEco[8], 0);
  133.     TextDrawSetProportional(CaixaEco[8], 1);
  134.     TextDrawSetShadow(CaixaEco[8], 1);
  135.     TextDrawUseBox(CaixaEco[8], 1);
  136.     TextDrawBoxColor(CaixaEco[8], 51380);
  137.     TextDrawTextSize(CaixaEco[8], 430.000000, 1.000000);
  138.  
  139.     CaixaEco[9] = TextDrawCreate(211.000000, 307.000000, "_");
  140.     TextDrawBackgroundColor(CaixaEco[9], 255);
  141.     TextDrawFont(CaixaEco[9], 1);
  142.     TextDrawLetterSize(CaixaEco[9], 0.500000, 5.199999);
  143.     TextDrawColor(CaixaEco[9], -1);
  144.     TextDrawSetOutline(CaixaEco[9], 0);
  145.     TextDrawSetProportional(CaixaEco[9], 1);
  146.     TextDrawSetShadow(CaixaEco[9], 1);
  147.     TextDrawUseBox(CaixaEco[9], 1);
  148.     TextDrawBoxColor(CaixaEco[9], 51380);
  149.     TextDrawTextSize(CaixaEco[9], 6.000000, 1.000000);
  150.  
  151.     CaixaEco[10] = TextDrawCreate(65.000000, 122.000000, "Sacar");
  152.     TextDrawBackgroundColor(CaixaEco[10], 255);
  153.     TextDrawFont(CaixaEco[10], 3);
  154.     TextDrawLetterSize(CaixaEco[10], 0.899999, 2.499999);
  155.     TextDrawColor(CaixaEco[10], -1);
  156.     TextDrawSetOutline(CaixaEco[10], 0);
  157.     TextDrawSetProportional(CaixaEco[10], 1);
  158.     TextDrawSetShadow(CaixaEco[10], 1);
  159.  
  160.     CaixaEco[11] = TextDrawCreate(28.000000, 215.000000, "transferir");
  161.     TextDrawBackgroundColor(CaixaEco[11], 255);
  162.     TextDrawFont(CaixaEco[11], 3);
  163.     TextDrawLetterSize(CaixaEco[11], 0.899999, 2.499999);
  164.     TextDrawColor(CaixaEco[11], -1);
  165.     TextDrawSetOutline(CaixaEco[11], 0);
  166.     TextDrawSetProportional(CaixaEco[11], 1);
  167.     TextDrawSetShadow(CaixaEco[11], 1);
  168.  
  169.     CaixaEco[12] = TextDrawCreate(16.000000, 317.000000, "emprestimo");
  170.     TextDrawBackgroundColor(CaixaEco[12], 255);
  171.     TextDrawFont(CaixaEco[12], 3);
  172.     TextDrawLetterSize(CaixaEco[12], 0.899999, 2.499999);
  173.     TextDrawColor(CaixaEco[12], -1);
  174.     TextDrawSetOutline(CaixaEco[12], 0);
  175.     TextDrawSetProportional(CaixaEco[12], 1);
  176.     TextDrawSetShadow(CaixaEco[12], 1);
  177.  
  178.     CaixaEco[13] = TextDrawCreate(504.000000, 317.000000, "/sairc");
  179.     TextDrawBackgroundColor(CaixaEco[13], 255);
  180.     TextDrawFont(CaixaEco[13], 3);
  181.     TextDrawLetterSize(CaixaEco[13], 0.899999, 2.499999);
  182.     TextDrawColor(CaixaEco[13], -1);
  183.     TextDrawSetOutline(CaixaEco[13], 0);
  184.     TextDrawSetProportional(CaixaEco[13], 1);
  185.     TextDrawSetShadow(CaixaEco[13], 1);
  186.  
  187.     CaixaEco[14] = TextDrawCreate(461.000000, 215.000000, "depositar");
  188.     TextDrawBackgroundColor(CaixaEco[14], 255);
  189.     TextDrawFont(CaixaEco[14], 3);
  190.     TextDrawLetterSize(CaixaEco[14], 0.899999, 2.499999);
  191.     TextDrawColor(CaixaEco[14], -1);
  192.     TextDrawSetOutline(CaixaEco[14], 0);
  193.     TextDrawSetProportional(CaixaEco[14], 1);
  194.     TextDrawSetShadow(CaixaEco[14], 1);
  195.  
  196.     CaixaEco[15] = TextDrawCreate(440.000000, 122.000000, "saldo conta");
  197.     TextDrawBackgroundColor(CaixaEco[15], 255);
  198.     TextDrawFont(CaixaEco[15], 3);
  199.     TextDrawLetterSize(CaixaEco[15], 0.899999, 2.499999);
  200.     TextDrawColor(CaixaEco[15], -1);
  201.     TextDrawSetOutline(CaixaEco[15], 0);
  202.     TextDrawSetProportional(CaixaEco[15], 1);
  203.     TextDrawSetShadow(CaixaEco[15], 1);
  204.  
  205.     CaixaEco[16] = TextDrawCreate(146.000000, 419.000000, ">> www.brasilconectlogo.com <<");
  206.     TextDrawBackgroundColor(CaixaEco[16], 255);
  207.     TextDrawFont(CaixaEco[16], 2);
  208.     TextDrawLetterSize(CaixaEco[16], 0.500000, 1.000000);
  209.     TextDrawColor(CaixaEco[16], -1);
  210.     TextDrawSetOutline(CaixaEco[16], 0);
  211.     TextDrawSetProportional(CaixaEco[16], 1);
  212.     TextDrawSetShadow(CaixaEco[16], 1);
  213.    
  214.     TextDrawSetSelectable(Text:CaixaEco[10], true);
  215.     TextDrawSetSelectable(Text:CaixaEco[11], true);
  216.     TextDrawSetSelectable(Text:CaixaEco[12], true);
  217.     TextDrawSetSelectable(Text:CaixaEco[14], true);
  218.     TextDrawSetSelectable(Text:CaixaEco[15], true);
  219.    
  220.     return 1;
  221. }
  222.  
  223. public OnFilterScriptExit()
  224. {
  225.         DOF2_Exit();
  226.     return 1;
  227. }
  228.  
  229. public OnPlayerConnect(playerid)
  230. {
  231.         LoadCaixa(playerid);
  232.     SendClientMessage(playerid, -1, " TUDO AQUI É UMA BASE PARA ADICIONAR AO SEU SERVE, BOA SORTE ABRAÇOS!!");
  233.     SendClientMessage(playerid, -1, " TUDO AQUI É UMA BASE PARA ADICIONAR AO SEU SERVE, BOA SORTE ABRAÇOS!!");
  234.     SendClientMessage(playerid, -1, " TUDO AQUI É UMA BASE PARA ADICIONAR AO SEU SERVE, BOA SORTE ABRAÇOS!!");
  235.     SendClientMessage(playerid, -1, " TUDO AQUI É UMA BASE PARA ADICIONAR AO SEU SERVE, BOA SORTE ABRAÇOS!!");
  236.     return 1;
  237. }
  238.  
  239. public OnPlayerDisconnect(playerid, reason)
  240. {
  241.         SalvarCaixa(playerid);
  242.     return 1;
  243. }
  244.  
  245. public OnPlayerRequestClass(playerid, classid)
  246. {
  247.  
  248.     return 1;
  249. }
  250.  
  251. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  252. {
  253.     if(dialogid == SacarCaixa)
  254.     {
  255.             if(!strval(inputtext)) return SendClientMessage(playerid, Rosa, "Operação inválida!");
  256.             if(!response) return SendClientMessage(playerid, Cinza, "Você cancelou o opção.");
  257.             else
  258.             {
  259.                 if(strval(inputtext) >= bInfo[playerid][Saldo]) return SendClientMessage(playerid, Rosa, #Você não tem esse dinheiro todo no banco);
  260.                 {
  261.                     GivePlayerMoney(playerid, strval(inputtext));
  262.                     bInfo[playerid][Saldo] =- strval(inputtext);
  263.  
  264.                     new string[120];
  265.                     format(string, sizeof(string), "Você sacou: R$: %d. Agora seu saldo é R$: %d",strval(inputtext), bInfo[playerid][Saldo]);
  266.                     SendClientMessage(playerid, Azul, string);
  267.                 }
  268.             }
  269.     }
  270.     if(dialogid == DepositarCaixa)
  271.     {
  272.             if(!strval(inputtext)) return SendClientMessage(playerid, -1, "Operação inválida!");
  273.             if(!response) return SendClientMessage(playerid, -1, "Você cancelou o opção.");
  274.             else
  275.             {
  276.                 if(bInfo[playerid][Dinheiro] >= strval(inputtext)) return SendClientMessage(playerid, -1, "Você não tem esse dinheiro");
  277.                 {
  278.                     bInfo[playerid][Saldo] += strval(inputtext);
  279.                     GivePlayerMoney(playerid, - strval(inputtext));
  280.  
  281.                     new string[120];
  282.                     format(string, sizeof(string), "Você depositou: R$: %d. Agora seu saldo é R$: %d",strval(inputtext), bInfo[playerid][Saldo]);
  283.                     SendClientMessage(playerid, Azul, string);
  284.                 }
  285.             }
  286.     }
  287.  
  288.     new transferido[MAX_PLAYERS];
  289.  
  290.     if(dialogid == TrasferirCaixa)
  291.     {
  292.             if(!strval(inputtext)) return SendClientMessage(playerid, -1, "Operação inválida!");
  293.             if(!response) return SendClientMessage(playerid, -1, "Você cancelou a opção");
  294.             else
  295.             {
  296.                 if(strval(inputtext) >= bInfo[playerid][Saldo]) return SendClientMessage(playerid, -1, "Você não tem esse dinheiro");
  297.                 {
  298.                     transferido[playerid] = strval(inputtext);
  299.                     ShowPlayerDialog(playerid, Dialog_acaboucaixa, DIALOG_STYLE_INPUT, "{0084FF}* Caixa Econômica *", "Digite o ID do player\nDigite apenas números", "Confirmar", "Cancelar");
  300.                 }
  301.         }
  302.     }
  303.     if(dialogid == Dialog_acaboucaixa)
  304.     {
  305.             if(!strval(inputtext)) return SendClientMessage(playerid, -1, "Operação inválida!");
  306.             if(!response) return SendClientMessage(playerid, -1, "Você cancelou a opção.");
  307.             else
  308.             {
  309.                     if(IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, -1, "Este jogador não está conectado");
  310.                     {
  311.                         bInfo[playerid][Saldo] =- transferido[playerid];
  312.                         bInfo[strval(inputtext)][Saldo] - transferido[playerid];
  313.  
  314.                         new
  315.                                 string[120],
  316.                                 nome[25]
  317.                         ;
  318.                         GetPlayerName(strval(inputtext), nome, 25);
  319.                         format(string, sizeof(string), "Você transferiu: R$: %d. Para %s. Agora seu saldo é R$: %d",transferido[playerid], nome, bInfo[playerid][Saldo]);
  320.                         SendClientMessage(playerid, -1, string);
  321.                         PlayerPlaySound(playerid, 1130, 0.0, 0.0, 10.0);
  322.                     }
  323.             }
  324.     }
  325.     return 1;
  326. }
  327.  
  328. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  329. {
  330.  
  331.     if(clickedid == CaixaEco[10])
  332.     {
  333.         new string[120];
  334.         format(string, sizeof(string), "Escolha o valor da quantia para sacar.\nSeu saldo é R$: %d", bInfo[playerid][Saldo]);
  335.         ShowPlayerDialog(playerid, SacarCaixa, DIALOG_STYLE_INPUT, "{0084FF}* Caixa Econômica *", string, "Confirmar", "Cancelar");
  336.     }
  337.     if(clickedid == CaixaEco[11])
  338.     {
  339.         new string[120];
  340.         format(string, sizeof(string), "Escolha o valor da quantia a ser transferida.\nSeu saldo é R$: %d", bInfo[playerid][Saldo]);
  341.         ShowPlayerDialog(playerid, TrasferirCaixa, DIALOG_STYLE_INPUT, "{0084FF}* Caixa Econômica *", string, "Confirmar", "Cancelar");
  342.     }
  343.     if(clickedid == CaixaEco[12])
  344.     {
  345.         GivePlayerMoney(playerid, 2000);
  346.         SendClientMessage(playerid, -1, "Você pegou R$ 2.000,00");
  347.     }
  348.     if(clickedid == CaixaEco[14])
  349.     {
  350.         new string[120];
  351.         format(string, sizeof(string), "Escolha o valor da quantia a ser depositada.\nSeu saldo é R$: %d", bInfo[playerid][Saldo]);
  352.         ShowPlayerDialog(playerid, DepositarCaixa, DIALOG_STYLE_INPUT, "Banco Los Santos", string, "Confirmar", "Cancelar");
  353.     }
  354.     if(clickedid == CaixaEco[15])
  355.     {
  356.         new string[120];
  357.         format(string, sizeof(string), "Seu saldo é R$: %d", bInfo[playerid][Saldo]);
  358.         SendClientMessage(playerid, -1, string);
  359.         return 1;
  360.     }
  361.     return 1;
  362. }
  363.  
  364. CMD:caixa(playerid)
  365. {
  366.     SelectTextDraw(playerid,0xE0FFFFFF);
  367.     TextDrawShowForPlayer(playerid, CaixaEco[0]);
  368.     TextDrawShowForPlayer(playerid, CaixaEco[1]);
  369.     TextDrawShowForPlayer(playerid, CaixaEco[2]);
  370.     TextDrawShowForPlayer(playerid, CaixaEco[3]);
  371.     TextDrawShowForPlayer(playerid, CaixaEco[4]);
  372.     TextDrawShowForPlayer(playerid, CaixaEco[5]);
  373.     TextDrawShowForPlayer(playerid, CaixaEco[6]);
  374.     TextDrawShowForPlayer(playerid, CaixaEco[7]);
  375.     TextDrawShowForPlayer(playerid, CaixaEco[8]);
  376.     TextDrawShowForPlayer(playerid, CaixaEco[9]);
  377.     TextDrawShowForPlayer(playerid, CaixaEco[10]);
  378.     TextDrawShowForPlayer(playerid, CaixaEco[11]);
  379.     TextDrawShowForPlayer(playerid, CaixaEco[12]);
  380.     TextDrawShowForPlayer(playerid, CaixaEco[13]);
  381.     TextDrawShowForPlayer(playerid, CaixaEco[14]);
  382.     TextDrawShowForPlayer(playerid, CaixaEco[15]);
  383.     TextDrawShowForPlayer(playerid, CaixaEco[16]);
  384.     return 1;
  385. }
  386.  
  387. CMD:sairc(playerid)
  388. {
  389.     CancelSelectTextDraw(playerid);
  390.     //for(new i = 4; i < sizeof(CaixaEco); i++) { TextDrawHideForPlayer(playerid, CaixaEco[i]); }
  391.     TextDrawHideForAll(CaixaEco[0]);//não mexer
  392.     //TextDrawDestroy(CaixaEco[0]);
  393.     TextDrawHideForAll(CaixaEco[1]);
  394.     //TextDrawDestroy(CaixaEco[1]);
  395.     TextDrawHideForAll(CaixaEco[2]);
  396.     //TextDrawDestroy(CaixaEco[2]);
  397.     TextDrawHideForAll(CaixaEco[3]);
  398.     //TextDrawDestroy(CaixaEco[3]);
  399.     TextDrawHideForAll(CaixaEco[4]);
  400.     //TextDrawDestroy(CaixaEco[4]);
  401.     TextDrawHideForAll(CaixaEco[5]);
  402.     //TextDrawDestroy(CaixaEco[5]);
  403.     TextDrawHideForAll(CaixaEco[6]);
  404.     //TextDrawDestroy(CaixaEco[6]);
  405.     TextDrawHideForAll(CaixaEco[7]);
  406.     //TextDrawDestroy(CaixaEco[7]);
  407.     TextDrawHideForAll(CaixaEco[8]);
  408.     //TextDrawDestroy(CaixaEco[8]);
  409.     TextDrawHideForAll(CaixaEco[9]);
  410.     //TextDrawDestroy(CaixaEco[9]);
  411.     TextDrawHideForAll(CaixaEco[10]);
  412.     //TextDrawDestroy(CaixaEco[10]);
  413.     TextDrawHideForAll(CaixaEco[11]);
  414.     //TextDrawDestroy(CaixaEco[11]);
  415.     TextDrawHideForAll(CaixaEco[12]);
  416.     //TextDrawDestroy(CaixaEco[12]);
  417.     TextDrawHideForAll(CaixaEco[13]);
  418.     //TextDrawDestroy(CaixaEco[13]);
  419.     TextDrawHideForAll(CaixaEco[14]);
  420.     //TextDrawDestroy(CaixaEco[14]);
  421.     TextDrawHideForAll(CaixaEco[15]);
  422.     //TextDrawDestroy(CaixaEco[15]);
  423.     TextDrawHideForAll(CaixaEco[16]);
  424.     //TextDrawDestroy(CaixaEco[16]);
  425.     return 1;
  426. }
  427.  
  428. stock SalvarCaixa(playerid)
  429. {
  430.     if(!DOF2_FileExists(Contas(playerid)))
  431.     {
  432.         DOF2_CreateFile(Contas(playerid));
  433.         SalvarCaixa(playerid);
  434.         return 1;
  435.     }
  436.     DOF2_SetInt(Contas(playerid),"Saldo",       bInfo[playerid][Saldo] );
  437.     DOF2_SetInt(Contas(playerid),"Dinheiro",    bInfo[playerid][Dinheiro]);
  438.  
  439.     DOF2_SaveFile();
  440.     return 1;
  441. }
  442.  
  443. stock LoadCaixa(playerid)
  444. {
  445.     bInfo[playerid][Saldo]      =   DOF2_GetInt(Contas(playerid), "Saldo");
  446.     bInfo[playerid][Dinheiro]   =   DOF2_GetInt(Contas(playerid), "Dinheiro");
  447.     return 1;
  448. }
  449.  
  450. stock Contas(playerid)
  451. {
  452.     new ArQ[50];
  453.     format(ArQ, 50, "ContasBanco/%s.ini", pNome(playerid));
  454.     return ArQ;
  455. }
  456.  
  457. stock pNome(playerid)
  458. {
  459.     new name[MAX_PLAYER_NAME];
  460.     GetPlayerName(playerid, name, sizeof(name));
  461.     return name;
  462. }
  463.  
  464. #endif
Advertisement
Add Comment
Please, Sign In to add comment