Guest User

Untitled

a guest
Jan 3rd, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.32 KB | None | 0 0
  1. CMD:withdraw(playerid, params[])
  2. {
  3. if(LogatPin[playerid] == 0) return SCM(playerid, -1, "Contul tau este {ff0000}blocat{ffffff}, foloseste {ff0000}/pin{ffffff} pentru a-l debloca");
  4. if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
  5. if(IsPlayerConnected(playerid))
  6. {
  7. if(IsAtBank(playerid))
  8. {
  9. new money,string[100];
  10. if(sscanf(params, "i", money))
  11. {
  12. SendClientMessage(playerid, 0xFFFFFFFF,"{00FFFF}Syntax: {ffffff}/withdraw <Amount of Money>");
  13. format(string, sizeof(string), "{FFFF00}You have $%s in your account.", FormatNumber(PlayerInfo[playerid][pAccount]));
  14. SendClientMessage(playerid, COLOR_WHITE, string);
  15. return 1;
  16. }
  17. if (money > PlayerInfo[playerid][pAccount] || money < 1) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You dont have that much.");
  18. ConsumingMoney[playerid] = 1;
  19. GivePlayerCash(playerid, money);
  20. PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-money;
  21. format(string, sizeof(string), "{FFFF00}You have withdrawn $%s from your account Total: $%s.", FormatNumber(money),FormatNumber(PlayerInfo[playerid][pAccount]));
  22. SendClientMessage(playerid, COLOR_WHITE, string);
  23. new str[168];
  24. mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Money`='%d',`Bank`='%d' WHERE `name`='%s'",GetPlayerCash(playerid),PlayerInfo[playerid][pAccount],PlayerInfo[playerid][pNormalName]);
  25. mysql_tquery(SQL,str,"","");
  26. return 1;
  27. }
  28. else
  29. {
  30. SendClientMessage(playerid, COLOR_WHITE, "Nu esti in Banca");
  31. return 1;
  32. }
  33. }
  34. return 1;
  35. }
  36. CMD:deposit(playerid, params[])
  37. {
  38. if(LogatPin[playerid] == 0) return SCM(playerid, -1, "Contul tau este {ff0000}blocat{ffffff}, foloseste {ff0000}/pin{ffffff} pentru a-l debloca");
  39. if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
  40. if(IsPlayerConnected(playerid))
  41. {
  42. if(IsAtBank(playerid))
  43. {
  44. new money,string[100];
  45. if(sscanf(params, "i", money))
  46. {
  47. SendClientMessage(playerid, 0xFFFFFFFF,"{00FFFF}Syntax: {ffffff}/withdraw <Amount of Money>");
  48. format(string, sizeof(string), "{FFFF00}You have $%s in your account.", FormatNumber(PlayerInfo[playerid][pAccount]));
  49. SendClientMessage(playerid, COLOR_WHITE, string);
  50. return 1;
  51. }
  52. if (money > GetPlayerCash(playerid) || money < 1) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You dont have that much.");
  53. GivePlayerCash(playerid, -money);
  54. new curfunds = PlayerInfo[playerid][pAccount];
  55. PlayerInfo[playerid][pAccount]=money+PlayerInfo[playerid][pAccount];
  56. SendClientMessage(playerid, COLOR_WHITE, "|___ BANK STATMENT ___|");
  57. format(string, sizeof(string), " Old Balance: $%s", FormatNumber(curfunds));
  58. SendClientMessage(playerid, COLOR_GRAD2, string);
  59. format(string, sizeof(string), " Deposit: $%s",FormatNumber(money));
  60. SendClientMessage(playerid, COLOR_GRAD4, string);
  61. SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
  62. format(string, sizeof(string), " New Balance: $%s", FormatNumber(PlayerInfo[playerid][pAccount]));
  63. SendClientMessage(playerid, COLOR_WHITE1, string);
  64. Update(playerid, pBank);
  65. Update(playerid, pCashx);
  66. return 1;
  67. }
  68. else
  69. {
  70. SendClientMessage(playerid, COLOR_WHITE, "Nu esti in Banca");
  71. return 1;
  72. }
  73. }
  74. return 1;
  75. }
  76. CMD:balance(playerid, params[])
  77. {
  78. if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
  79. if(IsPlayerConnected(playerid))
  80. {
  81. if(IsAtBank(playerid))
  82. {
  83. new string[100];
  84. format(string, sizeof(string), "{FFFF00}You have $%s in your account.", FormatNumber(PlayerInfo[playerid][pAccount]));
  85. SendClientMessage(playerid, COLOR_WHITE, string);
  86. }
  87. else
  88. {
  89. SendClientMessage(playerid, COLOR_WHITE, "Nu esti in Banca");
  90. return 1;
  91. }
  92. }
  93. return 1;
  94. }
  95. CMD:transfer(playerid, params[])
  96. {
  97. if(LogatPin[playerid] == 0) return SCM(playerid, -1, "Contul tau este {ff0000}blocat{ffffff}, foloseste {ff0000}/pin{ffffff} pentru a-l debloca");
  98. if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
  99. if(IsPlayerConnected(playerid))
  100. {
  101. if(PlayerInfo[playerid][pLevel] < 5) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}You need level 5 to do this.");
  102. if(IsAtBank(playerid))
  103. {
  104. new id,moneytransfer,string[100],giveplayer[30],sendername[30],playermoney;
  105. if(sscanf(params, "ui", id,moneytransfer)) return SendClientMessage(playerid, 0xFFFFFFFF,"{00FFFF}Syntax: {ffffff}/transfer <Name/Playerid> <Amount of Money>");
  106. if(playerid == id) return SCM(playerid,COLOR_WHITE,"{FFB870}You can not transfer the money to you");
  107. if(IsPlayerConnected(id))
  108. {
  109. if(id != INVALID_PLAYER_ID)
  110. {
  111. if(gPlayerLogged[id] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "This player need to login.");
  112. GetPlayerName(id, giveplayer, sizeof(giveplayer));
  113. GetPlayerName(playerid, sendername, sizeof(sendername));
  114. playermoney = PlayerInfo[playerid][pAccount];
  115. if (moneytransfer > 0 && playermoney >= moneytransfer)
  116. {
  117. if(PlayerInfo[playerid][pLevel] < 7 && moneytransfer > 10000000) return SCM(playerid, COLOR_WHITE, "Nu poti transfera mai mult de 10.000.000$ pana la level 7");
  118. if(PlayerInfo[id][pLevel] < 5 && moneytransfer > 10000000) return SCM(playerid, COLOR_WHITE, "Nu poti transfera mai mult de 10.000.000$ acelui player pana nu face level 5");
  119. new cashbank = floatround(floatmul(moneytransfer,0.10),floatround_ceil);
  120. format(string,sizeof(string),"Are you sure you want to transfer %s$ to %s?\nTax is $%s.",FormatNumber(moneytransfer),giveplayer,FormatNumber(cashbank));
  121. TransferOffer[playerid] = id;
  122. TransferMoney[playerid] = moneytransfer;
  123. ShowPlayerDialog(playerid, DIALOG_TRANSFER, DIALOG_STYLE_MSGBOX, "Transfer:", string, "Yes", "No");
  124. }
  125. else return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Invalid transaction amount.");
  126. }
  127. }
  128. else return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Player not connected.");
  129. }
  130. else return SendClientMessage(playerid, COLOR_WHITE, "Nu esti in Banca");
  131. }
  132. return 1;
  133. }
Advertisement
Add Comment
Please, Sign In to add comment