Advertisement
Guest User

Untitled

a guest
Aug 21st, 2016
479
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new money[MAX_PLAYERS];
  4. new new_money[MAX_PLAYERS];
  5. new Text:moneyTD[MAX_PLAYERS];
  6.  
  7. main()
  8. {
  9. print("\n----------------------------------");
  10. print("MoneyTD by MantasPwn");
  11. print("----------------------------------\n");
  12. }
  13.  
  14.  
  15. public OnGameModeInit()
  16. {
  17. SetTimer("moneyProfit", 333, true);
  18. return 1;
  19. }
  20.  
  21. public OnPlayerConnect(playerid)
  22. {
  23. moneyTD[playerid] = TextDrawCreate(500.000000, 99.000000, "");
  24. TextDrawBackgroundColor(moneyTD[playerid], -16776961);
  25. TextDrawFont(moneyTD[playerid], 1);
  26. TextDrawLetterSize(moneyTD[playerid], 0.440000, 1.899999);
  27. TextDrawColor(moneyTD[playerid], 16711935);
  28. TextDrawSetOutline(moneyTD[playerid], 0);
  29. TextDrawSetProportional(moneyTD[playerid], 1);
  30. TextDrawSetShadow(moneyTD[playerid], 0);
  31. TextDrawSetSelectable(moneyTD[playerid], 0);
  32. return 1;
  33. }
  34.  
  35. forward moneyProfitHide(playerid);
  36. public moneyProfitHide(playerid)
  37. {
  38. TextDrawHideForPlayer(playerid, moneyTD[playerid]);
  39. return 1;
  40. }
  41.  
  42.  
  43. forward moneyProfit();
  44. public moneyProfit()
  45. {
  46. for(new playerid; playerid < MAX_PLAYERS; playerid++)
  47. {
  48. if(IsPlayerConnected(playerid)){
  49. new_money[playerid] = GetPlayerMoney(playerid);
  50. new minus[15], plus[15];
  51. format(plus, sizeof(plus), "~g~+%i", new_money[playerid]-money[playerid]);
  52. format(minus, sizeof(minus), "~r~%i", new_money[playerid]-money[playerid]);
  53. if(new_money[playerid] > money[playerid])
  54. {
  55. TextDrawSetString(moneyTD[playerid], plus);
  56. TextDrawShowForPlayer(playerid, moneyTD[playerid]);
  57. SetTimerEx("moneyProfitHide", 2000, false, "i", playerid);
  58. }
  59. else if(new_money[playerid] < money[playerid])
  60. {
  61. TextDrawSetString(moneyTD[playerid], minus);
  62. TextDrawShowForPlayer(playerid, moneyTD[playerid]);
  63. SetTimerEx("moneyProfitHide", 2000, false, "i", playerid);
  64. }
  65. money[playerid] = new_money[playerid];
  66. }
  67. }
  68. return 1;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement