Hallo Icy.,
also nach dem Prinzip:
Unter GameModeInit:
for(new playerid = 0; playerid<MAX_PLAYERS; playerid++)
{
MoneyDraw[playerid] = TextDrawCreate(493.000000, 81.000000, "~g~Geld ~w~00000000");
TextDrawBackgroundColor(MoneyDraw[playerid], 255);
TextDrawFont(MoneyDraw[playerid], 3);
TextDrawLetterSize(MoneyDraw[playerid], 0.500000, 1.700000);
TextDrawColor(MoneyDraw[playerid], -1);
TextDrawSetOutline(MoneyDraw[playerid], 0);
TextDrawSetProportional(MoneyDraw[playerid], 1);
TextDrawSetShadow(MoneyDraw[playerid], 1);
TextDrawUseBox(MoneyDraw[playerid], 1);
TextDrawBoxColor(MoneyDraw[playerid], 0x000000FF);
TextDrawTextSize(MoneyDraw[playerid], 621.000000, 1.000000);
}
Unter OnPlayerConnect
TextDrawShowForPlayer(playerid, MoneyDraw[playerid]);
Einen Stock erstellen:
stock UpdatePlayerMoneyTextdraw(playerid)
{
new m = GetPlayerMoney(playerid), str[50];
if(m == 0) format(str, sizeof str, "~r~00000000");
else if(m < 10 && m > 0) format(str, sizeof str, "~g~Geld ~w~0000000%d", m);
else if(m < 100 && m >= 10) format(str, sizeof str, "~g~Geld ~w~000000%d", m);
else if(m < 1000 && m >= 100) format(str, sizeof str, "~g~Geld ~w~00000%d", m);
else if(m < 10000 && m >= 1000) format(str, sizeof str, "~g~Geld ~w~0000%d", m);
else if(m < 100000 && m >= 10000) format(str, sizeof str, "~g~Geld ~w~000%d", m);
else if(m < 1000000 && m >= 10000) format(str, sizeof str, "~g~Geld ~w~00%d", m);
else if(m < 10000000 && m >= 1000000) format(str, sizeof str, "~g~Geld ~w~0%d", m);
else if(m < 100000000 && m >= 10000000) format(str, sizeof str, "~g~Geld ~w~%d", m);
else format(str, sizeof str, "~g~Euro~w~%d", m);
TextDrawSetString(MoneyDraw[playerid], str);
return 1;
}
Und natürlich unter meinem Timer:
UpdatePlayerMoneyTextdraw(i);
wäre das so richtig?
Ich habs jetzt ma so frei versucht zu schreiben ...
Lg
J0a9