I was searching for your answer, as I really never tried making a money system with textdraw.
I found this, now of course, you have to re-write it in your code, as I just copy-pasted it.
pawn Код:
forward CheckMoney(playerid);
public CheckMoney(playerid)
{
new string[128];
if(GetPlayerMoney(playerid) < 10)
{
format(string, sizeof(string), "0000000%iFt", GetPlayerMoney(playerid));
TextDrawSetString(Ft[playerid], string);
TextDrawShowForPlayer(playerid, Ft[playerid]);
TextDrawShowForPlayer(playerid, Box[playerid]);
}
if(10 <= GetPlayerMoney(playerid) < 100)
{
format(string, sizeof(string), "000000%iFt", GetPlayerMoney(playerid));
TextDrawSetString(Ft[playerid], string);
TextDrawShowForPlayer(playerid, Ft[playerid]);
TextDrawShowForPlayer(playerid, Box[playerid]);
}
if(100 <= GetPlayerMoney(playerid) < 1000)
{
format(string, sizeof(string), "00000%iFt", GetPlayerMoney(playerid));
TextDrawSetString(Ft[playerid], string);
TextDrawShowForPlayer(playerid, Ft[playerid]);
TextDrawShowForPlayer(playerid, Box[playerid]);
}
if(1000 <= GetPlayerMoney(playerid) < 10000)
{
format(string, sizeof(string), "0000%iFt", GetPlayerMoney(playerid));
TextDrawSetString(Ft[playerid], string);
TextDrawShowForPlayer(playerid, Ft[playerid]);
TextDrawShowForPlayer(playerid, Box[playerid]);
}
if(10000 <= GetPlayerMoney(playerid) < 100000)
{
format(string, sizeof(string), "000%iFt", GetPlayerMoney(playerid));
TextDrawSetString(Ft[playerid], string);
TextDrawShowForPlayer(playerid, Ft[playerid]);
TextDrawShowForPlayer(playerid, Box[playerid]);
}
if(100000 <= GetPlayerMoney(playerid) < 1000000)
{
format(string, sizeof(string), "00%iFt", GetPlayerMoney(playerid));
TextDrawSetString(Ft[playerid], string);
TextDrawShowForPlayer(playerid, Ft[playerid]);
TextDrawShowForPlayer(playerid, Box[playerid]);
}
if(1000000 <= GetPlayerMoney(playerid) < 10000000)
{
format(string, sizeof(string), "0%iFt", GetPlayerMoney(playerid));
TextDrawSetString(Ft[playerid], string);
TextDrawShowForPlayer(playerid, Ft[playerid]);
TextDrawShowForPlayer(playerid, Box[playerid]);
}
if(10000000 <= GetPlayerMoney(playerid) < 999999999)
{
format(string, sizeof(string), "%iFt", GetPlayerMoney(playerid));
TextDrawSetString(Ft[playerid], string);
TextDrawShowForPlayer(playerid, Ft[playerid]);
TextDrawShowForPlayer(playerid, Box[playerid]);
}
return 1;
}