Guest User

CheckMoney TextDraw

a guest
Jul 24th, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.64 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new Text:Box[MAX_PLAYERS];
  4. new Text:Ft[MAX_PLAYERS];
  5. new check;
  6.  
  7. public OnFilterScriptInit()
  8. {
  9. print("\n|==========================================================|");
  10. print("\n| Forint script |");
  11. print("\n| Betöltve |");
  12. print("\n|==========================================================|");
  13.  
  14. return 1;
  15. }
  16.  
  17. public OnFilterScriptExit()
  18. {
  19. print("\n|==========================================================|");
  20. print("\n| Forint script |");
  21. print("\n| Kikapcsolva |");
  22. print("\n|==========================================================|");
  23.  
  24. KillTimer(check);
  25. return 1;
  26. }
  27.  
  28. public OnPlayerConnect(playerid)
  29. {
  30. Box[playerid] = TextDrawCreate(622.000000, 79.000000, " ");
  31. TextDrawBackgroundColor(Box[playerid], 255);
  32. TextDrawFont(Box[playerid], 1);
  33. TextDrawLetterSize(Box[playerid], 0.500000, 1.000000);
  34. TextDrawColor(Box[playerid], -1);
  35. TextDrawSetOutline(Box[playerid], 0);
  36. TextDrawSetProportional(Box[playerid], 1);
  37. TextDrawSetShadow(Box[playerid], 1);
  38. TextDrawUseBox(Box[playerid], 1);
  39. TextDrawBoxColor(Box[playerid], 0x000035FF);
  40. TextDrawTextSize(Box[playerid], 483.000000, 49.000000);
  41.  
  42. Ft[playerid] = TextDrawCreate(490.000000, 77.000000, "00000000Ft"); //a forint mindenhol legelől volt
  43. TextDrawBackgroundColor(Ft[playerid], 0xF5F51FFF);
  44. TextDrawFont(Ft[playerid], 1);
  45. TextDrawLetterSize(Ft[playerid], 0.539999, 2.299999);
  46. TextDrawColor(Ft[playerid], 0xCACA09FF);
  47. TextDrawSetOutline(Ft[playerid], 1);
  48. TextDrawSetProportional(Ft[playerid], 1);
  49.  
  50. SetTimerEx("CheckMoney", 2000, true, "i", playerid);
  51. return 1;
  52. }
  53.  
  54. public OnPlayerDisconnect(playerid)
  55. {
  56. TextDrawHideForPlayer(playerid, Ft[playerid]);
  57. TextDrawHideForPlayer(playerid, Box[playerid]);
  58. return 1;
  59. }
  60.  
  61. forward CheckMoney(playerid);
  62. public CheckMoney(playerid)
  63. {
  64. new string[128];
  65.  
  66. if(GetPlayerMoney(playerid) < 10)
  67. {
  68. format(string, sizeof(string), "0000000%iFt", GetPlayerMoney(playerid));
  69. TextDrawSetString(Ft[playerid], string);
  70. TextDrawShowForPlayer(playerid, Ft[playerid]);
  71. TextDrawShowForPlayer(playerid, Box[playerid]);
  72. }
  73.  
  74. if(10 <= GetPlayerMoney(playerid) < 100)
  75. {
  76. format(string, sizeof(string), "000000%iFt", GetPlayerMoney(playerid));
  77. TextDrawSetString(Ft[playerid], string);
  78. TextDrawShowForPlayer(playerid, Ft[playerid]);
  79. TextDrawShowForPlayer(playerid, Box[playerid]);
  80. }
  81.  
  82. if(100 <= GetPlayerMoney(playerid) < 1000)
  83. {
  84. format(string, sizeof(string), "00000%iFt", GetPlayerMoney(playerid));
  85. TextDrawSetString(Ft[playerid], string);
  86. TextDrawShowForPlayer(playerid, Ft[playerid]);
  87. TextDrawShowForPlayer(playerid, Box[playerid]);
  88. }
  89.  
  90. if(1000 <= GetPlayerMoney(playerid) < 10000)
  91. {
  92. format(string, sizeof(string), "0000%iFt", GetPlayerMoney(playerid));
  93. TextDrawSetString(Ft[playerid], string);
  94. TextDrawShowForPlayer(playerid, Ft[playerid]);
  95. TextDrawShowForPlayer(playerid, Box[playerid]);
  96. }
  97.  
  98. if(10000 <= GetPlayerMoney(playerid) < 100000)
  99. {
  100. format(string, sizeof(string), "000%iFt", GetPlayerMoney(playerid));
  101. TextDrawSetString(Ft[playerid], string);
  102. TextDrawShowForPlayer(playerid, Ft[playerid]);
  103. TextDrawShowForPlayer(playerid, Box[playerid]);
  104. }
  105.  
  106. if(100000 <= GetPlayerMoney(playerid) < 1000000)
  107. {
  108. format(string, sizeof(string), "00%iFt", GetPlayerMoney(playerid));
  109. TextDrawSetString(Ft[playerid], string);
  110. TextDrawShowForPlayer(playerid, Ft[playerid]);
  111. TextDrawShowForPlayer(playerid, Box[playerid]);
  112. }
  113.  
  114. if(1000000 <= GetPlayerMoney(playerid) < 10000000)
  115. {
  116. format(string, sizeof(string), "0%iFt", GetPlayerMoney(playerid));
  117. TextDrawSetString(Ft[playerid], string);
  118. TextDrawShowForPlayer(playerid, Ft[playerid]);
  119. TextDrawShowForPlayer(playerid, Box[playerid]);
  120. }
  121.  
  122. if(10000000 <= GetPlayerMoney(playerid) < 999999999)
  123. {
  124. format(string, sizeof(string), "%iFt", GetPlayerMoney(playerid));
  125. TextDrawSetString(Ft[playerid], string);
  126. TextDrawShowForPlayer(playerid, Ft[playerid]);
  127. TextDrawShowForPlayer(playerid, Box[playerid]);
  128. }
  129. return 1;
  130. }
Add Comment
Please, Sign In to add comment