Guest User

jesteibice

a guest
Apr 16th, 2020
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. #include <a_samp>
  2. #include <msc>
  3.  
  4. #define ABAIXO_DO_HUD
  5.  
  6. new Text:money_info[MAX_PLAYERS];
  7.  
  8. public OnFilterScriptInit()
  9. {
  10. print("\n--------------------------------------");
  11. print("[fs] parice");
  12. print("--------------------------------------\n");
  13. for (new playerid; playerid < MAX_PLAYERS; playerid++)
  14. {
  15. #if defined ABAIXO_DO_HUD
  16. money_info[playerid] = TextDrawCreate(372.942626, 81.666694, "");
  17. TextDrawBackgroundColor(money_info[playerid], 255);
  18. TextDrawFont(money_info[playerid], 3);
  19. TextDrawLetterSize(money_info[playerid], 0.409999, 1.699998);
  20. TextDrawColor(money_info[playerid], -1);
  21. TextDrawSetOutline(money_info[playerid], 1);
  22. TextDrawSetProportional(money_info[playerid], 1);
  23. TextDrawTextSize(money_info[playerid], 606.000000, 0.000000);
  24. #endif
  25.  
  26. #if defined ACIMA_DO_HUD
  27. money_info[playerid] = TextDrawCreate(372.942626, 81.666694, "");
  28. TextDrawBackgroundColor(money_info[playerid], 255);
  29. TextDrawFont(money_info[playerid], 3);
  30. TextDrawLetterSize(money_info[playerid], 0.409999, 1.699998);
  31. TextDrawColor(money_info[playerid], -1);
  32. TextDrawSetOutline(money_info[playerid], 1);
  33. TextDrawSetProportional(money_info[playerid], 1);
  34. TextDrawTextSize(money_info[playerid], 606.000000, 0.000000);
  35. #endif
  36. }
  37. return 1;
  38. }
  39.  
  40. public OnPlayerConnect(playerid)
  41. {
  42. TextDrawShowForPlayer(playerid, money_info[playerid]);
  43. return 1;
  44. }
  45.  
  46. public OnPlayerMoneyStateChange(playerid, newmoney, oldmoney, bool:scripted)
  47. {
  48. #define time 1000
  49. new ganho = newmoney - oldmoney, string[128];
  50. if(ganho > 0) format(string, sizeof(string), "~g~+ $%d", ganho);
  51. if(ganho < 0) format(string, sizeof(string), "~r~$%d", ganho);
  52. TextDrawSetString(money_info[playerid], string), SetTimerEx("hide_txt", time, false, "d", playerid);
  53. return 1;
  54. }
  55.  
  56. forward hide_txt(playerid);
  57. public hide_txt(playerid)
  58. {
  59. TextDrawSetString(money_info[playerid], "");
  60. }
Advertisement
Add Comment
Please, Sign In to add comment