Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ------------------------------------------
- //
- // Include Moeda Brasileira por Mori4rty
- //
- // ------------------------------------------
- #include <a_samp>
- new Text:Dinheiro[MAX_PLAYERS];
- new MoriString[128];
- new PlayerMoney[MAX_PLAYERS];
- #define HideTextDrawMoney(%0) TextDrawHideForPlayer(%0, Dinheiro[%0])
- stock GivePlayerMoneyBR(playerid, money)
- {
- PlayerMoney[playerid] += money;
- format(MoriString, sizeof MoriString, "R$%s", Comma(PlayerMoney[playerid]));
- TextDrawSetString(Dinheiro[playerid], MoriString);
- return true;
- }
- stock GetPlayerMoneyBR(playerid)
- {
- format(MoriString, sizeof MoriString, "%s", Comma(PlayerMoney[playerid]));
- return ( MoriString );
- }
- stock ResetPlayerMoneyBR(playerid)
- {
- PlayerMoney[playerid] = 0;
- format(MoriString, sizeof MoriString, "R$%s", Comma(PlayerMoney[playerid]));
- TextDrawSetString(Dinheiro[playerid], MoriString);
- return true;
- }
- stock CreateTextDrawMoney()
- {
- for(new playerid; playerid < MAX_PLAYERS; ++playerid)
- {
- Dinheiro[playerid] = TextDrawCreate(3.000000, 426.000000, "R$100,000,000,00");
- TextDrawBackgroundColor(Dinheiro[playerid], 255);
- TextDrawFont(Dinheiro[playerid], 3);
- TextDrawLetterSize(Dinheiro[playerid], 0.500000, 2.099999);
- TextDrawColor(Dinheiro[playerid], -10270721);
- TextDrawSetOutline(Dinheiro[playerid], 1);
- TextDrawSetProportional(Dinheiro[playerid], 1);
- }
- return true;
- }
- stock ShowTextDrawMoney(playerid)
- {
- format(MoriString, sizeof MoriString, "R$%s", Comma(PlayerMoney[playerid]));
- TextDrawSetString(Dinheiro[playerid], MoriString);
- TextDrawShowForPlayer(playerid, Dinheiro[playerid]);
- return true;
- }
- stock Comma(numbers) //by Gamer931215
- {
- new temp[24],counter = -1;
- valstr(temp,numbers);
- for(new i = strlen(temp);i > 0; i--)
- {
- counter++;
- if(counter == 3)
- {
- strins(temp,",",i);
- counter = 0;
- }
- }
- return temp;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement