Advertisement
Guest User

Untitled

a guest
Jun 8th, 2014
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.92 KB | None | 0 0
  1. // ------------------------------------------
  2. //
  3. //  Include Moeda Brasileira por Mori4rty
  4. //
  5. // ------------------------------------------
  6. #include <a_samp>
  7.  
  8. new Text:Dinheiro[MAX_PLAYERS];
  9. new MoriString[128];
  10. new PlayerMoney[MAX_PLAYERS];
  11. #define HideTextDrawMoney(%0)   TextDrawHideForPlayer(%0, Dinheiro[%0])
  12.  
  13. stock GivePlayerMoneyBR(playerid, money)
  14. {
  15.     PlayerMoney[playerid] += money;
  16.     format(MoriString, sizeof MoriString, "R$%s", Comma(PlayerMoney[playerid]));
  17.     TextDrawSetString(Dinheiro[playerid], MoriString);
  18.     return true;
  19. }
  20.  
  21. stock GetPlayerMoneyBR(playerid)
  22. {
  23.     format(MoriString, sizeof MoriString, "%s", Comma(PlayerMoney[playerid]));
  24.     return ( MoriString );
  25. }
  26.  
  27. stock ResetPlayerMoneyBR(playerid)
  28. {
  29.     PlayerMoney[playerid] = 0;
  30.     format(MoriString, sizeof MoriString, "R$%s", Comma(PlayerMoney[playerid]));
  31.     TextDrawSetString(Dinheiro[playerid], MoriString);
  32.     return true;
  33. }
  34.  
  35. stock CreateTextDrawMoney()
  36. {
  37.     for(new playerid; playerid < MAX_PLAYERS; ++playerid)
  38.     {
  39.         Dinheiro[playerid] = TextDrawCreate(3.000000, 426.000000, "R$100,000,000,00");
  40.         TextDrawBackgroundColor(Dinheiro[playerid], 255);
  41.         TextDrawFont(Dinheiro[playerid], 3);
  42.         TextDrawLetterSize(Dinheiro[playerid], 0.500000, 2.099999);
  43.         TextDrawColor(Dinheiro[playerid], -10270721);
  44.         TextDrawSetOutline(Dinheiro[playerid], 1);
  45.         TextDrawSetProportional(Dinheiro[playerid], 1);
  46.     }
  47.     return true;
  48. }
  49.  
  50. stock ShowTextDrawMoney(playerid)
  51. {
  52.     format(MoriString, sizeof MoriString, "R$%s", Comma(PlayerMoney[playerid]));
  53.     TextDrawSetString(Dinheiro[playerid], MoriString);
  54.     TextDrawShowForPlayer(playerid, Dinheiro[playerid]);
  55.     return true;
  56. }
  57.  
  58. stock Comma(numbers) //by Gamer931215
  59. {
  60.     new temp[24],counter = -1;
  61.     valstr(temp,numbers);
  62.     for(new i = strlen(temp);i > 0; i--)
  63.     {
  64.         counter++;
  65.         if(counter == 3)
  66.         {
  67.             strins(temp,",",i);
  68.             counter = 0;
  69.         }
  70.     }
  71.     return temp;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement