Money Textdraw
#1

To make money cheats useless i thought to use a textdraw (over the originals Moneybar) which shows the money the player has at the moment. The Textdraw is just a text (align right, color: green, as high/width as the original one, no background).
You all know that the original moneybar changes the color from green to red if you have debt (- $). My textdraw should change the color too, so i did this:
Код:
stock GiveUserMoney(playerid, amount)
{
	new
	  string[15];
	GivePlayerMoney(playerid, amount);
	pScriptMoney[playerid] += amount;
	if(pScriptMoney[playerid] < 0)
	{
	  TextDrawColor(MoneyText[playerid], 0x9C1619FF);
		format(string, sizeof(string), "%d", -1*pScriptMoney[playerid]);
	}
	else
	{
	  TextDrawColor(MoneyText[playerid], 0x2E5725FF);
	  format(string, sizeof(string), "%d", pScriptMoney[playerid]);
	}
	TextDrawSetString(MoneyText[playerid], string);
}
It works and it changes the color, but im not sure if this is the best method to do it, because every time a player gets/loses money the color changes and a string is set. I think its to complex for the server, exspecially if many players are online. So i asked you if there is any other way to do it?
Reply


Messages In This Thread
Money Textdraw - by Doktor - 06.06.2009, 12:40
Re: Money Textdraw - by Weirdosport - 06.06.2009, 12:57
Re: Money Textdraw - by Doktor - 06.06.2009, 13:16

Forum Jump:


Users browsing this thread: 1 Guest(s)