StAnger

[FilterScript] Money Info

Dec 20th, 2013
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.48 KB | None | 0 0
  1. /*
  2.     Money Info (Infomação quando há alteração no dinheiro do jogador)
  3.  
  4.     Esse Filterscript contém códigos de:
  5.     Vit0r, Dragonsaurus (msc.inc)
  6.  
  7.     (Favor não remover os créditos)
  8. */
  9.  
  10. #include <a_samp>
  11. #include <msc>
  12.  
  13. #define ABAIXO_DO_HUD
  14.  
  15. new Text:money_info[MAX_PLAYERS];
  16.  
  17. public OnFilterScriptInit()
  18. {
  19.     print("\n--------------------------------------");
  20.     print("[fs] bf_money.amx carregado");
  21.     print("--------------------------------------\n");
  22.     for (new playerid; playerid < MAX_PLAYERS; playerid++)
  23.     {
  24.         #if defined ABAIXO_DO_HUD
  25.         money_info[playerid] = TextDrawCreate(498.000000, 103.000000, "");
  26.         TextDrawBackgroundColor(money_info[playerid], 255);
  27.         TextDrawFont(money_info[playerid], 3);
  28.         TextDrawLetterSize(money_info[playerid], 0.409999, 1.699998);
  29.         TextDrawColor(money_info[playerid], -1);
  30.         TextDrawSetOutline(money_info[playerid], 1);
  31.         TextDrawSetProportional(money_info[playerid], 1);
  32.         TextDrawUseBox(money_info[playerid], 1);
  33.         TextDrawBoxColor(money_info[playerid], -11324638);
  34.         TextDrawTextSize(money_info[playerid], 606.000000, 0.000000);
  35.         #endif
  36.  
  37.         #if defined ACIMA_DO_HUD
  38.         money_info[playerid] = TextDrawCreate(498.000000, 4.000000, "");
  39.         TextDrawBackgroundColor(money_info[playerid], 255);
  40.         TextDrawFont(money_info[playerid], 3);
  41.         TextDrawLetterSize(money_info[playerid], 0.409999, 1.699998);
  42.         TextDrawColor(money_info[playerid], -1);
  43.         TextDrawSetOutline(money_info[playerid], 1);
  44.         TextDrawSetProportional(money_info[playerid], 1);
  45.         TextDrawUseBox(money_info[playerid], 1);
  46.         TextDrawBoxColor(money_info[playerid], -11324638);
  47.         TextDrawTextSize(money_info[playerid], 606.000000, 0.000000);
  48.         #endif
  49.     }
  50.     return 1;
  51. }
  52.  
  53. public OnPlayerConnect(playerid)
  54. {
  55.     TextDrawShowForPlayer(playerid, money_info[playerid]);
  56.     return 1;
  57. }
  58.  
  59. public OnPlayerMoneyStateChange(playerid, newmoney, oldmoney, bool:scripted)
  60. {
  61.     #define time 3000
  62.     new ganho = newmoney - oldmoney, string[128];
  63.     if(ganho > 0) format(string, sizeof(string), "~g~+ $%d", ganho);
  64.     if(ganho < 0) format(string, sizeof(string), "~r~$%d", ganho);
  65.     TextDrawSetString(money_info[playerid], string), SetTimerEx("hide_txt", time, false, "d", playerid);
  66.     return 1;
  67. }
  68.  
  69. forward hide_txt(playerid);
  70. public hide_txt(playerid)
  71. {
  72.     TextDrawSetString(money_info[playerid], "");
  73. }
Add Comment
Please, Sign In to add comment