Advertisement
Guest User

Unique ATM System v1.1 By [BR]Zorono [MYSQL]

a guest
Jul 29th, 2016
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 37.17 KB | None | 0 0
  1. //==============================================================================
  2. #include <a_samp>
  3. #include <a_mysql>
  4. #include <sscanf2>
  5. #include <streamer>
  6. #include <zcmd>
  7. //======================================//
  8. native WP_Hash(buffer[], len, const str[]);
  9. //==============================================================================
  10. #define SQL_HOST "localhost"
  11. #define SQL_USER "root"
  12. #define SQL_PASS ""
  13. #define SQL_DB ""
  14. //==============================================================================
  15. #define red 0xFF0000AA
  16. #define yellow 0xFFFF00AA
  17. #define blue 0x00FFFFAA
  18. //==============================================================================
  19. #define DIALOG_OTHER 900
  20. #define DIALOG_TM 901
  21. #define DIALOG_BANK_WITHDRAW 902
  22. #define DIALOG_BANK_DEPOSIT 903
  23. #define DIALOG_BANK_RECEIPT 904
  24. #define DIALOG_ATR 905
  25. #define DIALOG_FS 906
  26. #define DIALOG_LS 907
  27. #define DIALOG_AGE 908
  28. #define DIALOG_DOB 909
  29. #define DIALOG_CO 910
  30. #define DIALOG_CI 911
  31. #define DIALOG_PASS 912
  32. #define DIALOG_LOGIN 913
  33. //==============================================================================
  34. #define MAX_ATMS 200
  35. #define MAX_USES 10
  36. //==============================================================================
  37. enum AccountInfo
  38. {
  39.     Registered,
  40.     FS,
  41.     LS,
  42.     Money,
  43.     Age,
  44.     DOB,
  45.     Country,
  46.     City,
  47.     Password[128],
  48.     Officer
  49. };
  50. enum ATMInfo
  51. {
  52.     Float:aX,
  53.     Float:aY,
  54.     Float:aZ,
  55.     Float:aA,
  56.     Text3D:aLabel,
  57.     aID,
  58.     aCP,
  59.     aObje,
  60.     aName[56]
  61. };
  62. new PlayerInfo[MAX_PLAYERS][AccountInfo];
  63. new TMInfo[MAX_ATMS][ATMInfo];
  64. new catm = 1;
  65. new aString[76];
  66. new Float:PosLoad_A[4];
  67. new PlayerText:atmklik[MAX_PLAYERS][19];
  68. new player1;
  69. new AUSE_LIMIT[MAX_ATMS] = 1;
  70. new mysql;
  71. //==============================================================================
  72. public OnFilterScriptInit()
  73. {
  74.     print("===========================================================");
  75.     printf("|FS Name: Unique ATM Bank System v1.1");
  76.     printf("|Scripted By: [BR]Zorono");
  77.     print("===========================================================");
  78.     mysql_log(LOG_ERROR | LOG_WARNING | LOG_DEBUG);
  79.     mysql = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
  80.     if(mysql_errno(mysql) == 1)
  81.     {
  82.         printf("[MYSQL]: Connection to `%s` failed!",SQL_DB);
  83.     }
  84.     else
  85.     {
  86.         printf("[MYSQL]: Connection to `%s` succesful!",SQL_DB);
  87.     }
  88.     return 1;
  89. }
  90.  
  91. public OnFilterScriptExit()
  92. {
  93.    mysql_close();
  94.    DestroyATM();
  95.    return 1;
  96. }
  97.  
  98. public OnPlayerConnect(playerid)
  99. {
  100.     atmklik[playerid][0] = CreatePlayerTextDraw(playerid, 105.799949, 53.453338, "LD_SPAC:white");
  101.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][0], 0.000000, 0.000000);
  102.     PlayerTextDrawTextSize(playerid, atmklik[playerid][0], 437.000000, 312.000000);
  103.     PlayerTextDrawAlignment(playerid, atmklik[playerid][0], 1);
  104.     PlayerTextDrawColor(playerid, atmklik[playerid][0], 0);
  105.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][0], 0);
  106.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][0], 0);
  107.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][0], 255);
  108.     PlayerTextDrawFont(playerid, atmklik[playerid][0], 4);
  109.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][0], 0);
  110.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][0], 0);
  111.  
  112.     atmklik[playerid][1] = CreatePlayerTextDraw(playerid, 160.025085, 86.759971, "box");
  113.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][1], 0.000000, 27.439989);
  114.     PlayerTextDrawTextSize(playerid, atmklik[playerid][1], 492.000000, 0.000000);
  115.     PlayerTextDrawAlignment(playerid, atmklik[playerid][1], 1);
  116.     PlayerTextDrawColor(playerid, atmklik[playerid][1], -1);
  117.     PlayerTextDrawUseBox(playerid, atmklik[playerid][1], 1);
  118.     PlayerTextDrawBoxColor(playerid, atmklik[playerid][1], 6149119);
  119.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][1], 0);
  120.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][1], 0);
  121.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][1], 255);
  122.     PlayerTextDrawFont(playerid, atmklik[playerid][1], 1);
  123.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][1], 1);
  124.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][1], 0);
  125.  
  126.     atmklik[playerid][2] = CreatePlayerTextDraw(playerid, 379.599853, 93.516616, "PT. SA:Bank");
  127.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][2], 0.400000, 1.600000);
  128.     PlayerTextDrawAlignment(playerid, atmklik[playerid][2], 3);
  129.     PlayerTextDrawColor(playerid, atmklik[playerid][2], -1);
  130.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][2], 0);
  131.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][2], 0);
  132.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][2], 255);
  133.     PlayerTextDrawFont(playerid, atmklik[playerid][2], 2);
  134.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][2], 1);
  135.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][2], 0);
  136.  
  137.     atmklik[playerid][3] = CreatePlayerTextDraw(playerid, 390.000091, 118.319976, "Choose Your Action");
  138.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][3], 0.400000, 1.600000);
  139.     PlayerTextDrawAlignment(playerid, atmklik[playerid][3], 3);
  140.     PlayerTextDrawColor(playerid, atmklik[playerid][3], -1);
  141.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][3], 0);
  142.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][3], 0);
  143.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][3], 255);
  144.     PlayerTextDrawFont(playerid, atmklik[playerid][3], 2);
  145.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][3], 1);
  146.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][3], 0);
  147.  
  148.     atmklik[playerid][4] = CreatePlayerTextDraw(playerid, 195.599975, 136.496582, "===========================");
  149.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][4], 0.400000, 1.600000);
  150.     PlayerTextDrawAlignment(playerid, atmklik[playerid][4], 1);
  151.     PlayerTextDrawColor(playerid, atmklik[playerid][4], -1);
  152.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][4], 0);
  153.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][4], 0);
  154.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][4], 255);
  155.     PlayerTextDrawFont(playerid, atmklik[playerid][4], 1);
  156.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][4], 1);
  157.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][4], 0);
  158.  
  159.     atmklik[playerid][5] = CreatePlayerTextDraw(playerid, 286.000396, 171.800216, "<---------- $ 1000");
  160.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][5], 0.400000, 1.600000);
  161.     PlayerTextDrawAlignment(playerid, atmklik[playerid][5], 3);
  162.     PlayerTextDrawColor(playerid, atmklik[playerid][5], -1);
  163.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][5], 0);
  164.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][5], 0);
  165.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][5], 255);
  166.     PlayerTextDrawFont(playerid, atmklik[playerid][5], 2);
  167.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][5], 1);
  168.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][5], 0);
  169.  
  170.     atmklik[playerid][6] = CreatePlayerTextDraw(playerid, 289.400634, 201.839935, "<---------- $ 5000");
  171.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][6], 0.400000, 1.600000);
  172.     PlayerTextDrawAlignment(playerid, atmklik[playerid][6], 3);
  173.     PlayerTextDrawColor(playerid, atmklik[playerid][6], -1);
  174.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][6], 0);
  175.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][6], 0);
  176.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][6], 255);
  177.     PlayerTextDrawFont(playerid, atmklik[playerid][6], 2);
  178.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][6], 1);
  179.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][6], 0);
  180.  
  181.     atmklik[playerid][7] = CreatePlayerTextDraw(playerid, 299.501251, 237.940093, "<---------- $ 10.000");
  182.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][7], 0.400000, 1.600000);
  183.     PlayerTextDrawAlignment(playerid, atmklik[playerid][7], 3);
  184.     PlayerTextDrawColor(playerid, atmklik[playerid][7], -1);
  185.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][7], 0);
  186.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][7], 0);
  187.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][7], 255);
  188.     PlayerTextDrawFont(playerid, atmklik[playerid][7], 2);
  189.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][7], 1);
  190.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][7], 0);
  191.  
  192.     atmklik[playerid][8] = CreatePlayerTextDraw(playerid, 303.326507, 274.066650, "<---------- $ 20.000");
  193.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][8], 0.400000, 1.600000);
  194.     PlayerTextDrawAlignment(playerid, atmklik[playerid][8], 3);
  195.     PlayerTextDrawColor(playerid, atmklik[playerid][8], -1);
  196.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][8], 0);
  197.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][8], 0);
  198.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][8], 255);
  199.     PlayerTextDrawFont(playerid, atmklik[playerid][8], 2);
  200.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][8], 1);
  201.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][8], 0);
  202.  
  203.     atmklik[playerid][9] = CreatePlayerTextDraw(playerid, 494.799926, 172.520477, "Other ---------->");
  204.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][9], 0.400000, 1.600000);
  205.     PlayerTextDrawAlignment(playerid, atmklik[playerid][9], 3);
  206.     PlayerTextDrawColor(playerid, atmklik[playerid][9], -1);
  207.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][9], 0);
  208.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][9], 0);
  209.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][9], 255);
  210.     PlayerTextDrawFont(playerid, atmklik[playerid][9], 2);
  211.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][9], 1);
  212.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][9], 0);
  213.  
  214.     atmklik[playerid][10] = CreatePlayerTextDraw(playerid, 489.199920, 202.346694, "Transfer ---------->");
  215.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][10], 0.400000, 1.600000);
  216.     PlayerTextDrawAlignment(playerid, atmklik[playerid][10], 3);
  217.     PlayerTextDrawColor(playerid, atmklik[playerid][10], -1);
  218.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][10], 0);
  219.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][10], 0);
  220.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][10], 255);
  221.     PlayerTextDrawFont(playerid, atmklik[playerid][10], 2);
  222.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][10], 1);
  223.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][10], 0);
  224.  
  225.     atmklik[playerid][11] = CreatePlayerTextDraw(playerid, 488.099822, 273.453002, "Exit ---------->");
  226.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][11], 0.400000, 1.600000);
  227.     PlayerTextDrawAlignment(playerid, atmklik[playerid][11], 3);
  228.     PlayerTextDrawColor(playerid, atmklik[playerid][11], -1);
  229.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][11], 0);
  230.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][11], 0);
  231.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][11], 255);
  232.     PlayerTextDrawFont(playerid, atmklik[playerid][11], 2);
  233.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][11], 1);
  234.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][11], 0);
  235.  
  236.     atmklik[playerid][12] = CreatePlayerTextDraw(playerid, 113.600028, 166.713577, "LD_SPAC:white");
  237.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][12], 0.000000, 0.000000);
  238.     PlayerTextDrawTextSize(playerid, atmklik[playerid][12], 40.000000, 26.000000);
  239.     PlayerTextDrawAlignment(playerid, atmklik[playerid][12], 1);
  240.     PlayerTextDrawColor(playerid, atmklik[playerid][12], -3457537);
  241.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][12], 0);
  242.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][12], 0);
  243.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][12], 255);
  244.     PlayerTextDrawFont(playerid, atmklik[playerid][12], 4);
  245.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][12], 0);
  246.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][12], 0);
  247.     PlayerTextDrawSetSelectable(playerid, atmklik[playerid][12], true);
  248.  
  249.     atmklik[playerid][13] = CreatePlayerTextDraw(playerid, 113.000038, 199.053405, "LD_SPAC:white");
  250.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][13], 0.000000, 0.000000);
  251.     PlayerTextDrawTextSize(playerid, atmklik[playerid][13], 40.000000, 26.000000);
  252.     PlayerTextDrawAlignment(playerid, atmklik[playerid][13], 1);
  253.     PlayerTextDrawColor(playerid, atmklik[playerid][13], -3457537);
  254.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][13], 0);
  255.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][13], 0);
  256.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][13], 255);
  257.     PlayerTextDrawFont(playerid, atmklik[playerid][13], 4);
  258.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][13], 0);
  259.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][13], 0);
  260.     PlayerTextDrawSetSelectable(playerid, atmklik[playerid][13], true);
  261.  
  262.     atmklik[playerid][14] = CreatePlayerTextDraw(playerid, 113.000053, 231.906768, "LD_SPAC:white");
  263.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][14], 0.000000, 0.000000);
  264.     PlayerTextDrawTextSize(playerid, atmklik[playerid][14], 40.000000, 26.000000);
  265.     PlayerTextDrawAlignment(playerid, atmklik[playerid][14], 1);
  266.     PlayerTextDrawColor(playerid, atmklik[playerid][14], -3457537);
  267.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][14], 0);
  268.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][14], 0);
  269.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][14], 255);
  270.     PlayerTextDrawFont(playerid, atmklik[playerid][14], 4);
  271.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][14], 0);
  272.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][14], 0);
  273.     PlayerTextDrawSetSelectable(playerid, atmklik[playerid][14], true);
  274.  
  275.     atmklik[playerid][15] = CreatePlayerTextDraw(playerid, 112.900047, 266.006835, "LD_SPAC:white");
  276.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][15], 0.000000, 0.000000);
  277.     PlayerTextDrawTextSize(playerid, atmklik[playerid][15], 40.000000, 26.000000);
  278.     PlayerTextDrawAlignment(playerid, atmklik[playerid][15], 1);
  279.     PlayerTextDrawColor(playerid, atmklik[playerid][15], -3457537);
  280.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][15], 0);
  281.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][15], 0);
  282.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][15], 255);
  283.     PlayerTextDrawFont(playerid, atmklik[playerid][15], 4);
  284.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][15], 0);
  285.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][15], 0);
  286.     PlayerTextDrawSetSelectable(playerid, atmklik[playerid][15], true);
  287.  
  288.     atmklik[playerid][16] = CreatePlayerTextDraw(playerid, 498.199676, 166.367080, "LD_SPAC:white");
  289.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][16], 0.000000, 0.000000);
  290.     PlayerTextDrawTextSize(playerid, atmklik[playerid][16], 40.000000, 26.000000);
  291.     PlayerTextDrawAlignment(playerid, atmklik[playerid][16], 1);
  292.     PlayerTextDrawColor(playerid, atmklik[playerid][16], -3457537);
  293.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][16], 0);
  294.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][16], 0);
  295.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][16], 255);
  296.     PlayerTextDrawFont(playerid, atmklik[playerid][16], 4);
  297.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][16], 0);
  298.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][16], 0);
  299.     PlayerTextDrawSetSelectable(playerid, atmklik[playerid][16], true);
  300.  
  301.     atmklik[playerid][17] = CreatePlayerTextDraw(playerid, 498.999633, 198.060119, "LD_SPAC:white");
  302.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][17], 0.000000, 0.000000);
  303.     PlayerTextDrawTextSize(playerid, atmklik[playerid][17], 40.000000, 26.000000);
  304.     PlayerTextDrawAlignment(playerid, atmklik[playerid][17], 1);
  305.     PlayerTextDrawColor(playerid, atmklik[playerid][17], -3457537);
  306.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][17], 0);
  307.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][17], 0);
  308.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][17], 255);
  309.     PlayerTextDrawFont(playerid, atmklik[playerid][17], 4);
  310.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][17], 0);
  311.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][17], 0);
  312.     PlayerTextDrawSetSelectable(playerid, atmklik[playerid][17], true);
  313.  
  314.     atmklik[playerid][18] = CreatePlayerTextDraw(playerid, 497.799743, 266.006958, "LD_SPAC:white");
  315.     PlayerTextDrawLetterSize(playerid, atmklik[playerid][18], 0.000000, 0.000000);
  316.     PlayerTextDrawTextSize(playerid, atmklik[playerid][18], 40.000000, 26.000000);
  317.     PlayerTextDrawAlignment(playerid, atmklik[playerid][18], 1);
  318.     PlayerTextDrawColor(playerid, atmklik[playerid][18], -3457537);
  319.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][18], 0);
  320.     PlayerTextDrawSetOutline(playerid, atmklik[playerid][18], 0);
  321.     PlayerTextDrawBackgroundColor(playerid, atmklik[playerid][18], 255);
  322.     PlayerTextDrawFont(playerid, atmklik[playerid][18], 4);
  323.     PlayerTextDrawSetProportional(playerid, atmklik[playerid][18], 0);
  324.     PlayerTextDrawSetShadow(playerid, atmklik[playerid][18], 0);
  325.     PlayerTextDrawSetSelectable(playerid, atmklik[playerid][18], true);
  326.     return 1;
  327. }
  328.  
  329. public OnPlayerDisconnect(playerid, reason)
  330. {
  331.     new query[128];
  332.     mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `FS`=%s, `LS`=%s, `Money`=%d, `Age`=%d, `DOB`=%f, `Country`=%s, `City`=%s, `Officer`=%s WHERE `Username`=%s",\
  333.     PlayerInfo[playerid][FS], PlayerInfo[playerid][LS], PlayerInfo[playerid][Money], PlayerInfo[playerid][Age], PlayerInfo[playerid][DOB], PlayerInfo[playerid][Country], PlayerInfo[playerid][City], PlayerInfo[playerid][Officer]);
  334.     mysql_tquery(mysql, query, "", "");
  335.     return 1;
  336. }
  337.  
  338. forward ATM_Load();
  339. public ATM_Load()
  340. {
  341.     PosLoad_A[0] = cache_get_field_content_float(3, "atmx");
  342.     PosLoad_A[1] = cache_get_field_content_float(3, "atmy");
  343.     PosLoad_A[2] = cache_get_field_content_float(3, "atmz");
  344.     PosLoad_A[3] = cache_get_field_content_float(3, "atma");
  345.     cache_get_field_content(0, "isim", aString, mysql, 129);
  346.     CreateATM(aString, PosLoad_A[0], PosLoad_A[1], PosLoad_A[2], PosLoad_A[3]);
  347.     printf("ATM: %s loaded.", aString);
  348.     return 1;
  349. }
  350.  
  351. stock DestroyATM()
  352. {
  353.     for(new i = false; i <= MAX_ATMS; i++)
  354.     {
  355.         TMInfo[i][aX] = -1;
  356.         TMInfo[i][aY] = -1;
  357.         TMInfo[i][aZ] = -1;
  358.         TMInfo[i][aA] = -1;
  359.         TMInfo[i][aID] = -1;
  360.         Delete3DTextLabel(TMInfo[i][aLabel]);
  361.         DestroyDynamicObject(TMInfo[i][aObje]);
  362.         DestroyDynamicCP(TMInfo[i][aCP]);
  363.     }
  364.     catm = 1;
  365.     return 1;
  366. }
  367.  
  368. stock CreateATM(atmname[], Float:aaX, Float:aaY, Float:aaZ, Float:aaA){
  369.     new atmName[100];
  370.     format(atmName,76,"{ffffff}%s(%i)\n{ffffff}State: {77c97d}Active\nPress 'Y' To Open ATM Optians List", atmname, catm);
  371.     TMInfo[catm][aX] = aaX;
  372.     TMInfo[catm][aY] = aaY;
  373.     TMInfo[catm][aZ] = aaZ;
  374.     TMInfo[catm][aA] = aaA;
  375.     TMInfo[catm][aID] = catm;
  376.     TMInfo[catm][aCP] =  CreateDynamicCP(aaX, aaY, aaZ, 1.0,-1,-1,-1,100.0);
  377.     TMInfo[catm][aLabel] = Create3DTextLabel(atmName, 0x6F006FFF, aaX, aaY, aaZ, 25.0, 0, 0);
  378.     TMInfo[catm][aObje] = CreateDynamicObject(2942, TMInfo[catm][aX], TMInfo[catm][aY], TMInfo[catm][aZ]-0.5, 0.0000000, 0.0000000, TMInfo[catm][aA]);
  379.     format(TMInfo[catm][aName], 56, "%s", atmname);
  380.     catm++;
  381.     return true;
  382. }
  383.  
  384. forward MessageToOfficers(color,const string[]);
  385. public MessageToOfficers(color,const string[])
  386. {
  387.     for(new i = 0; i < MAX_PLAYERS; i++)
  388.     {
  389.         if(IsPlayerConnected(i) == 1) if (PlayerInfo[i][Officer] >= 1) SendClientMessage(i, color, string);
  390.     }
  391.     return 1;
  392. }
  393.  
  394. stock PlayerName2(playerid)
  395. {
  396.   new plname[MAX_PLAYER_NAME];
  397.   GetPlayerName(playerid, plname, sizeof(plname));
  398.   return plname;
  399. }
  400.  
  401. public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  402. {
  403.         if(playertextid  == atmklik[playerid][5])
  404.         {
  405.             SendClientMessage(playerid, 0xA3B4C5FF, "You Have Recived $1000 From your Bank Account!");
  406.             GivePlayerMoney(playerid, 1000);
  407.             PlayerInfo[playerid][Money] -= 1000;
  408.             CancelSelectTextDraw(playerid);
  409.             for(new a=0 ; a<20 ; a++)
  410.             PlayerTextDrawHide(playerid, atmklik[playerid][a]);
  411.         }
  412.         if(playertextid  == atmklik[playerid][6])
  413.         {
  414.             SendClientMessage(playerid, 0xA3B4C5FF, "You Have Recived $5000 From your Bank Account!");
  415.             GivePlayerMoney(playerid, 5000);
  416.             PlayerInfo[playerid][Money] -= 5000;
  417.             CancelSelectTextDraw(playerid);
  418.             for(new a=0 ; a<20 ; a++)
  419.             PlayerTextDrawHide(playerid, atmklik[playerid][a]);
  420.         }
  421.         if(playertextid  == atmklik[playerid][7])
  422.         {
  423.             SendClientMessage(playerid, 0xA3B4C5FF, "You Have Recived $10.000 From your Bank Account!");
  424.             GivePlayerMoney(playerid, 10000);
  425.             PlayerInfo[playerid][Money] -= 10000;
  426.             CancelSelectTextDraw(playerid);
  427.             for(new a=0 ; a<20 ; a++)
  428.             PlayerTextDrawHide(playerid, atmklik[playerid][a]);
  429.         }
  430.         if(playertextid  == atmklik[playerid][8])
  431.         {
  432.             SendClientMessage(playerid, 0xA3B4C5FF, "You Have Recived $20.000 From your Bank Account!");
  433.             GivePlayerMoney(playerid, 20000);
  434.             PlayerInfo[playerid][Money] -= 20000;
  435.             CancelSelectTextDraw(playerid);
  436.             for(new a=0 ; a<20 ; a++)
  437.             PlayerTextDrawHide(playerid, atmklik[playerid][a]);
  438.         }
  439.         if(playertextid  == atmklik[playerid][9])
  440.         {
  441.             ShowPlayerDialog(playerid, DIALOG_OTHER, DIALOG_STYLE_LIST, "{FFFF00}Bank Optians", "Deposit a money\nWithdraw a Money\nCheck My Balance", "Select", "Cancel");
  442.             CancelSelectTextDraw(playerid);
  443.             for(new a=0 ; a<20 ; a++)
  444.             PlayerTextDrawHide(playerid, atmklik[playerid][a]);
  445.         }
  446.         if(playertextid  == atmklik[playerid][10])
  447.         {
  448.             ShowPlayerDialog(playerid,DIALOG_TM, DIALOG_STYLE_INPUT,"{FFFF00}Bank","Please, put here the Player ID that you need tranfer him a Money","Ok","Cancel");
  449.             CancelSelectTextDraw(playerid);
  450.             for(new a=0 ; a<20 ; a++)
  451.             PlayerTextDrawHide(playerid, atmklik[playerid][a]);
  452.         }
  453.         if(playertextid  == atmklik[playerid][11])
  454.         {
  455.             CancelSelectTextDraw(playerid);
  456.             for(new a=0 ; a<20 ; a++)
  457.             PlayerTextDrawHide(playerid, atmklik[playerid][a]);
  458.         }
  459.         return 1;
  460. }
  461.  
  462. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  463. {
  464. if(dialogid == DIALOG_OTHER && response)
  465. {
  466. switch(listitem)
  467. {
  468. case 0:
  469. {
  470. ShowPlayerDialog(playerid, DIALOG_BANK_DEPOSIT, DIALOG_STYLE_INPUT, "{33CCFF}Bank Deposit", "{FFFFFF}Please choose an amount of money you would like to deposit.\n{33CCFF}Note: {FFFFFF}This amount can not be more than the amount you currently have on you player\nand the min amount you can deposit is {33AA33}$1.", "Deposit", "Cancel");
  471. }
  472. case 1:
  473. {
  474. ShowPlayerDialog(playerid, DIALOG_BANK_WITHDRAW, DIALOG_STYLE_INPUT, "{33CCFF}Bank Withdraw", "{FFFFFF}Please choose an amount of money you would like to withdraw.\n{33CCFF}Note: {FFFFFF}This amount can not be more than the amount you currently have in your bank account\nand the min amount you can withdraw is {33AA33}$1.", "Withdraw", "Cancel");
  475. }
  476. case 2:
  477. {
  478. new string[128];
  479. format(string,sizeof(string),"You Have In Your Bank Account: $%d", PlayerInfo[playerid][Money]);
  480. SendClientMessage(playerid,0xA3B4C5FF,string);
  481. }
  482. }
  483. }
  484. if(dialogid == DIALOG_TM && response)
  485. {
  486. player1 = strval(inputtext);
  487. if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid)
  488. {
  489. ShowPlayerDialog(playerid, DIALOG_ATR, DIALOG_STYLE_INPUT, "Bank","{00FFFF}Please Enter The Amount Of money you want Tranfer it!","Apply","Cancel");
  490. }
  491. }
  492.  
  493. if(dialogid == DIALOG_ATR && response)
  494. {
  495. GivePlayerMoney(playerid, -strval(inputtext));
  496. PlayerInfo[playerid][Money] -= strval(inputtext);
  497. PlayerInfo[player1][Money] += strval(inputtext);
  498. }
  499. if(dialogid == DIALOG_BANK_DEPOSIT && response)
  500. {
  501. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_BANK_DEPOSIT, DIALOG_STYLE_INPUT, "{33CCFF}Deposit", "{FFFFFF}Please choose an amount of money you would like to deposit.\n{33CCFF}Note: {FFFFFF}This amount can not be more than the amount you currently have on you player\nand the min amount you can deposit is {33AA33}$1.", "Deposit", "Cancel");
  502. if(strval(inputtext) > GetPlayerMoney(playerid) || strval(inputtext) < 1) return ShowPlayerDialog(playerid, DIALOG_BANK_DEPOSIT, DIALOG_STYLE_INPUT, "{33CCFF}Deposit", "{FF0000}Invalid amount!\n{FFFFFF}Please choose an amount of money you would like to deposit.\n{33CCFF}Note: {FFFFFF}This amount can not be more than the amount you currently have on you player\nand the min amount you can deposit is {33AA33}$1.", "Deposit", "Cancel");
  503. new str[128];
  504. GivePlayerMoney(playerid, -strval(inputtext));
  505. PlayerInfo[playerid][Money] += strval(inputtext);
  506. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  507. format(str, sizeof str, "{FFFFFF}You have deposited: {33AA33}$%d\n\n{FFFFFF}Your new bank balance is {33AA33}$%d", strval(inputtext), PlayerInfo[playerid][Money]);
  508. ShowPlayerDialog(playerid, DIALOG_BANK_RECEIPT, DIALOG_STYLE_MSGBOX, "{33CCFF}Deposited", str, "Ok", "");
  509. }
  510. if(dialogid == DIALOG_BANK_WITHDRAW && response)
  511. {
  512. new str[128], stringo[128];
  513. for(new i = false; i <= MAX_ATMS; i++)
  514. {
  515. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_BANK_WITHDRAW, DIALOG_STYLE_INPUT, "{33CCFF}Withdraw", "{FFFFFF}Please choose an amount of money you would like to withdraw.\n{33CCFF}Note: {FFFFFF}This amount can not be more than the amount you currently have in your bank account\nand the min amount you can withdraw is {33AA33}$1.", "Withdraw", "Cancel");
  516. if(strval(inputtext) > PlayerInfo[playerid][Money] || strval(inputtext) < 1) return ShowPlayerDialog(playerid, DIALOG_BANK_WITHDRAW, DIALOG_STYLE_INPUT, "{33CCFF}Withdraw", "{FF0000}Invalid amount!/n{FFFFFF}Please choose an amount of money you would like to withdraw.\n{33CCFF}Note: {FFFFFF}This amount can not be more than the amount you currently have in your bank account\nand the min amount you can withdraw is {33AA33}$1.", "Withdraw", "Cancel");
  517. if(AUSE_LIMIT[i] >= MAX_USES) {
  518. SendClientMessage(playerid, red, "Maximum limit reached. Please Wait untill A Bank Officer Refill This ATM Bancher!");
  519. format(stringo, sizeof stringo, "[SA:Bank]:ATM ID:%d, Has reaced Limit Of Uses, Please Refill It!", i);
  520. MessageToOfficers(yellow, stringo);
  521. return 1;
  522. }
  523. GivePlayerMoney(playerid, strval(inputtext));
  524. PlayerInfo[playerid][Money] -= strval(inputtext);
  525. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  526. AUSE_LIMIT[i]++;
  527. format(str, sizeof str, "{FFFFFF}You have withdraw: {33AA33}$%d\n\n{FFFFFF}Your new bank balance is {33AA33}$%d.", strval(inputtext), PlayerInfo[playerid][Money]);
  528. ShowPlayerDialog(playerid, DIALOG_BANK_RECEIPT, DIALOG_STYLE_MSGBOX, "{33CCFF}Withdraw", str, "Ok", "");
  529. GivePlayerMoney(playerid, strval(inputtext));
  530.   }
  531. }
  532. if(dialogid == DIALOG_FS && response)
  533. {
  534. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_FS, DIALOG_STYLE_INPUT, "Bank", "{33AA33}Please Enter Your First Name!", "Okay", "Cancel");
  535. PlayerInfo[playerid][FS] = strlen(inputtext);
  536. ShowPlayerDialog(playerid, DIALOG_LS, DIALOG_STYLE_INPUT, "Bank", "Please Enter Your Last Name!", "Okay", "Cancel");
  537. }
  538. if(dialogid == DIALOG_LS && response)
  539. {
  540. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_LS, DIALOG_STYLE_INPUT, "Bank", "{33AA33}Please Enter Your Last Name!", "Okay", "Cancel");
  541. PlayerInfo[playerid][LS] = strlen(inputtext);
  542. ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Bank", "Please Enter Your Age!", "Okay", "Cancel");
  543. }
  544. if(dialogid == DIALOG_AGE && response)
  545. {
  546. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Bank", "{33AA33}Please Enter Your Age!", "Okay", "Cancel");
  547. PlayerInfo[playerid][Age] = strval(inputtext);
  548. ShowPlayerDialog(playerid, DIALOG_DOB, DIALOG_STYLE_INPUT, "Bank", "Please Enter Your Date Of Birth!", "Okay", "Cancel");
  549. }
  550. if(dialogid == DIALOG_DOB && response)
  551. {
  552. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_DOB, DIALOG_STYLE_INPUT, "Bank", "{33AA33}Please Enter Your Date Of Birth!", "Okay", "Cancel");
  553. PlayerInfo[playerid][DOB] = strlen(inputtext);
  554. ShowPlayerDialog(playerid, DIALOG_CO, DIALOG_STYLE_INPUT, "Bank", "Please Enter Your Country!", "Okay", "Cancel");
  555. }
  556. if(dialogid == DIALOG_CO && response)
  557. {
  558. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_CO, DIALOG_STYLE_INPUT, "Bank", "{33AA33}Please Enter Your Country!", "Okay", "Cancel");
  559. PlayerInfo[playerid][Country] = strlen(inputtext);
  560. ShowPlayerDialog(playerid, DIALOG_CI, DIALOG_STYLE_INPUT, "Bank", "Please Enter Your City!", "Okay", "Cancel");
  561. }
  562. if(dialogid == DIALOG_CI && response)
  563. {
  564. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_CI, DIALOG_STYLE_INPUT, "Bank", "{33AA33}Please Enter Your City!", "Okay", "Cancel");
  565. PlayerInfo[playerid][City] = strlen(inputtext);
  566. ShowPlayerDialog(playerid, DIALOG_PASS, DIALOG_STYLE_INPUT, "Bank", "Please Enter Your Permant Password\nNote:You Must Save Your Password To Be able to acess Your Account on any Time!", "Okay", "Cancel");
  567. }
  568. if(dialogid == DIALOG_PASS && response)
  569. {
  570. new string[200],query[500];
  571. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_PASS, DIALOG_STYLE_INPUT, "Bank", "Please Enter Your Permant Password\nNote:You Must Save Your Password To Be able to acess Your Account on any Time!", "Okay", "Cancel");
  572. SendClientMessage(playerid,red,"Congratz: You Have Suessfully Created Your Own ATM Bank Account. You Can Access It in any time From any San Andreas ATM Bank Pranch!");
  573. format(string,sizeof(string),"[INFO]: Your Current Balance: $0");
  574. SendClientMessage(playerid,0xA3B4C5FF,string);
  575. WP_Hash(PlayerInfo[playerid][Password], 129, inputtext);
  576. mysql_format(mysql, query, sizeof(query), "INSERT INTO `players` (`Username`, `FS`, `LS`, `Money`, `Age`, `DOB` ,`Country`, `City`, `Password`, `Officer`) VALUES ('%e', '%s', '%s', '%s', 0, '%d', '%s', '%s', '%s', 0)", PlayerName2(playerid), PlayerInfo[playerid][FS], PlayerInfo[playerid][LS], PlayerInfo[playerid][Age], PlayerInfo[playerid][DOB], PlayerInfo[playerid][Country], PlayerInfo[playerid][City], PlayerInfo[playerid][Password]);
  577. mysql_tquery(mysql, query, "OnAccountRegister", "i", playerid);
  578. }
  579. if(dialogid == DIALOG_LOGIN && response)
  580. {
  581. new hpass[129], query[100];
  582. WP_Hash(hpass, 129, inputtext);
  583. if(!strcmp(hpass, PlayerInfo[playerid][Password]))
  584. {
  585. mysql_format(mysql, query, sizeof(query), "SELECT * FROM `players` WHERE `Username` = '%e' LIMIT 1", PlayerName2(playerid));
  586. mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid);
  587. SelectTextDraw(playerid, 0xA3B4C5FF);
  588. for (new x=0 ; x<20 ;x++) {
  589. PlayerTextDrawShow(playerid, atmklik[playerid][x]);
  590. PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  591. }
  592. }
  593. else
  594. {
  595. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Bank", "Please Enter Your Password To Acess Your Account!", "Login", "Cancel");
  596. }
  597. }
  598. return 1;
  599. }
  600.  
  601. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  602. {
  603.     if(newkeys & KEY_YES)
  604.     {
  605.     for(new i = false; i <= MAX_ATMS; i++)
  606.     {
  607.         if(IsPlayerInRangeOfPoint(playerid,5.0,TMInfo[i][aX],TMInfo[i][aY],TMInfo[i][aZ])) {
  608.         new query[128];
  609.         mysql_format(mysql, query, sizeof(query),"SELECT `Password`, `FS`, `LS`, `Money`, `Age`, `DOB`, `Country`, `City` FROM `players` WHERE `Username` = '%e' LIMIT 1", PlayerName2(playerid));
  610.         mysql_tquery(mysql, query, "OnAccountCheck", "i", playerid);
  611.         }
  612.       }
  613.     }
  614.     return 1;
  615. }
  616.  
  617. CMD:catm(playerid,params[])
  618. {
  619.     new aNeym[56],query[128];
  620.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not RCON Admin!");
  621.     if(sscanf(params, "s[56]", aNeym)) return SendClientMessage(playerid, -1, "Usage: /catm [ATM Text]");
  622.     if(catm >= MAX_ATMS) return SendClientMessage(playerid, -1, "Maximum limit reached!");
  623.     else {
  624.     new string[126], Float: gPos[4];
  625.     GetPlayerPos(playerid, gPos[0], gPos[1], gPos[2]);
  626.     GetPlayerFacingAngle(playerid, gPos[3]);
  627.     mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `isim`=%d, `atmx`=%f, `atmy`=%f, `atmz`=%f, `atma`=%f WHERE `Aid`=%d",\
  628.     aNeym, gPos[0], gPos[1], gPos[2], gPos[3], catm);
  629.     mysql_tquery(mysql, query, "", "");
  630.     CreateATM(aNeym, gPos[0], gPos[1], gPos[2], gPos[3]);
  631.     format(string, sizeof string, "You Have Successfully Created:%s | ATM ID: %d", aNeym, catm-1);
  632.     SendClientMessage(playerid, -1, string);
  633.     }
  634.     return 1;
  635. }
  636.  
  637. CMD:datm(playerid,params[])
  638. {
  639.     new aid,query[128];
  640.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not RCON Admin!");
  641.     if(sscanf(params, "i", aid)) return SendClientMessage(playerid, -1, "Usage: /datm [ATM ID]");
  642.     else {
  643.     mysql_format(mysql, query, sizeof(query), "DELETE FROM banks WHERE atmx = '%f', atmy = '%f', atmz = '%f', atma = '%f', Aid = '%d'",\
  644.     TMInfo[aid][aX], TMInfo[aid][aY], TMInfo[aid][aZ], TMInfo[aid][aA], aid);
  645.     mysql_tquery(mysql, query, "", "");
  646.     TMInfo[aid][aX] = -1;
  647.     TMInfo[aid][aY] = -1;
  648.     TMInfo[aid][aZ] = -1;
  649.     TMInfo[aid][aA] = -1;
  650.     TMInfo[aid][aID] = -1;
  651.     Delete3DTextLabel(TMInfo[aid][aLabel]);
  652.     DestroyDynamicCP(TMInfo[aid][aCP]);
  653.     DestroyDynamicObject(TMInfo[aid][aObje]);
  654.     catm--;
  655.     if(catm == 0) catm = 1;
  656.     }
  657.     return 1;
  658. }
  659.  
  660. CMD:ratm(playerid,params[])
  661. {
  662. if(PlayerInfo[playerid][Officer] == 1) {
  663. for(new i = false; i <= MAX_ATMS; i++)
  664. {
  665. if(IsPlayerInRangeOfPoint(playerid,2.0,TMInfo[i][aX],TMInfo[i][aY],TMInfo[i][aZ])) {
  666. AUSE_LIMIT[i] = 0;
  667. }
  668. }
  669. } else return SendClientMessage(playerid,red,"ERROR: You aren't ATM Bank Officer to use this Command!");
  670. return 1;
  671. }
  672.  
  673. CMD:setoff(playerid, params[])
  674. {
  675. new ID,orank,admname[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME];
  676. if(IsPlayerAdmin(playerid))
  677. {
  678. if(sscanf(params,"ui",ID,orank)) {
  679. SendClientMessage(playerid,red, "Usage: /setoff [id] [Rank]");
  680. SendClientMessage(playerid,red, "1 - Junior Officer");
  681. SendClientMessage(playerid,red, "2 - Senior Officer");
  682. SendClientMessage(playerid,red, "3 - Master Officer");
  683. return 1;
  684. }
  685. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,red, "Player is not connected");
  686. GetPlayerName(playerid,admname, MAX_PLAYER_NAME);
  687. GetPlayerName(ID,pname,MAX_PLAYER_NAME);
  688. PlayerInfo[ID][Officer] = orank;
  689. new string[128];
  690. format(string,sizeof(string),"ERROR: Player is already this Rank");
  691. if(PlayerInfo[ID][Officer] == orank) return SendClientMessage(playerid,red,string);
  692. format(string,sizeof(string),"Congratz:Admin %s has set you to ATM Bank Officer Rank Status | V.I.P Rank: %d |",admname,orank);
  693. SendClientMessage(ID,blue,string);
  694. format(string,sizeof(string),"You have made %s ATM Bank Officer Rank %d",pname,orank);
  695. SendClientMessage(playerid,blue,string);
  696. } else return SendClientMessage(playerid,red,"ERROR: You need to be RCON Administrator to use this command");
  697. return 1;
  698. }
  699.  
  700. CMD:offs(playerid,params[])
  701. {
  702.     #pragma unused params
  703.     new count = 0;
  704.     new string[128];
  705.     new OFFRank[128];
  706.     SendClientMessage(playerid,blue, " ");
  707.     SendClientMessage(playerid,blue, "___________ |- Online ATM Bank Officers -| ___________");
  708.     SendClientMessage(playerid,blue, " ");
  709.     for(new i = 0; i < MAX_PLAYERS; i++)
  710.     {
  711.         if (IsPlayerConnected(i))
  712.         {
  713.             if(PlayerInfo[i][Officer] >= 1 )
  714.             {
  715.  
  716.                 {
  717.                     switch(PlayerInfo[i][Officer])
  718.                     {
  719.                         case 1: {
  720.                             OFFRank = "Junior Officer";
  721.                         }
  722.                         case 2: {
  723.                             OFFRank = "Senior Officer";
  724.                         }
  725.                         case 3: {
  726.                             OFFRank = "Master Officer";
  727.                         }
  728.                     }
  729.                 }
  730.                 format(string, 128, "Rank: %d - %s (ID:%i) | %s |",PlayerInfo[i][Officer], PlayerName2(i),i,OFFRank);
  731.                 SendClientMessage(playerid, yellow, string);
  732.                 count++;
  733.             }
  734.         }
  735.     }
  736.     if (count == 0)
  737.     SendClientMessage(playerid,blue,"No ATM Bank Officers online ");
  738.     SendClientMessage(playerid,blue, " _______________________________________");
  739.     return 1;
  740. }
  741.  
  742. forward OnAccountCheck(playerid);
  743. public OnAccountCheck(playerid)
  744. {
  745.     new rows, fields;
  746.     cache_get_data(rows, fields, mysql);
  747.     if(rows)
  748.     {
  749.         cache_get_field_content(0, "FS", PlayerInfo[playerid][FS], mysql, 129);
  750.         cache_get_field_content(0, "LS", PlayerInfo[playerid][LS], mysql, 129);
  751.         cache_get_field_content(0, "Money", PlayerInfo[playerid][Money], mysql, 129);
  752.         cache_get_field_content(0, "Age", PlayerInfo[playerid][Age], mysql, 129);
  753.         cache_get_field_content(0, "DOB", PlayerInfo[playerid][DOB], mysql, 129);
  754.         cache_get_field_content(0, "Country", PlayerInfo[playerid][Country], mysql, 129);
  755.         cache_get_field_content(0, "City", PlayerInfo[playerid][City], mysql, 129);
  756.         cache_get_field_content(0, "Password", PlayerInfo[playerid][Password], mysql, 129);
  757.         cache_get_field_content(0, "Officer", PlayerInfo[playerid][Officer], mysql, 129);
  758.         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Bank", "Please Enter Your Password To Acess Your Account!", "Login", "Cancel");
  759.     }
  760.     else
  761.     {
  762.         SendClientMessage(playerid,red,"ERROR: You Haven't Any ATM Bank Account Yet.");
  763.         ShowPlayerDialog(playerid, DIALOG_FS, DIALOG_STYLE_INPUT, "Bank","{00FFFF}Please Enter Your First Name!","Ok","Cancel");
  764.  
  765.     }
  766.     return 1;
  767. }
  768.  
  769. forward OnAccountLoad(playerid);
  770. public OnAccountLoad(playerid)
  771. {
  772.     cache_get_field_content(0, "FS", PlayerInfo[playerid][FS], mysql, 129);
  773.     cache_get_field_content(0, "LS", PlayerInfo[playerid][LS], mysql, 129);
  774.     cache_get_field_content_int(0, "Money", PlayerInfo[playerid][Money]);
  775.     cache_get_field_content_int(0, "Age", PlayerInfo[playerid][Age]);
  776.     cache_get_field_content(0, "DOB", PlayerInfo[playerid][DOB], mysql, 129);
  777.     cache_get_field_content(0, "Country", PlayerInfo[playerid][Country], mysql, 129);
  778.     cache_get_field_content(0, "City", PlayerInfo[playerid][City], mysql, 129);
  779.     cache_get_field_content(0, "Password", PlayerInfo[playerid][Password], mysql, 129);
  780.     cache_get_field_content_int(0, "Officer", PlayerInfo[playerid][Officer]);
  781.     SendClientMessage(playerid, -1, "Successfully logged in");
  782.     return 1;
  783. }
  784.  
  785. forward OnAccountRegister(playerid);
  786. public OnAccountRegister(playerid)
  787. {
  788.     printf("New account registered. ID: %d", playerid);
  789.     return 1;
  790. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement