SA-MP Forums Archive
Help, textdraw problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help, textdraw problem (/showthread.php?tid=442987)



Help, textdraw problem - Alienwar3 - 09.06.2013

hello friends, good hise one string TextDraw with a bank, is below the TextDraw of money was so good before:
TextDraw of money: $000000010
TextDraw bank: $100
Then I wanted to make it look like this:
TextDraw of money: $000000010
TextDraw bank: $000000100
But do not know why'm like:
TextDraw of money: $000000010
Bank TextDraw $000000000100
How I can do to make it look how I want it?
I leave the code:
pawn Код:
new xxx[291]
    if(IsPlayerConnected(playerid))
    {
            if(PlayerInfo[playerid][pAccount] < 0 || PlayerInfo[playerid][pAccount] > 9){
            format(xxx, sizeof(xxx), "$0000000%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
            else if(PlayerInfo[playerid][pAccount] < 10 || PlayerInfo[playerid][pAccount] > 99){
            format(xxx, sizeof(xxx), "$000000%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
            else if(PlayerInfo[playerid][pAccount] < 100 || PlayerInfo[playerid][pAccount] > 999){
            format(xxx, sizeof(xxx), "$000000%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
            else if(PlayerInfo[playerid][pAccount] < 1000 || PlayerInfo[playerid][pAccount] > 9999){
            format(xxx, sizeof(xxx), "$00000%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
            else if(PlayerInfo[playerid][pAccount] < 10000 || PlayerInfo[playerid][pAccount] > 99999){
            format(xxx, sizeof(xxx), "$0000%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
            else if(PlayerInfo[playerid][pAccount] < 100000 || PlayerInfo[playerid][pAccount] > 999999){
            format(xxx, sizeof(xxx), "$000%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
            else if(PlayerInfo[playerid][pAccount] < 1000000 || PlayerInfo[playerid][pAccount] > 9999999){
            format(xxx, sizeof(xxx), "$00%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
            else if(PlayerInfo[playerid][pAccount] < 10000000 || PlayerInfo[playerid][pAccount] > 99999999){
            format(xxx, sizeof(xxx), "$0%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
            else if(PlayerInfo[playerid][pAccount] < 100000000 || PlayerInfo[playerid][pAccount] > 999999999){
            format(xxx, sizeof(xxx), "$%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawHideForPlayer(playerid, TextdrawBank1[playerid]);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
    }



Respuesta: Help, textdraw problem - Alienwar3 - 11.06.2013

HELP ME!


Re: Help, textdraw problem - feartonyb - 11.06.2013

Код:
new xxx[291]
    if(IsPlayerConnected(playerid))
    {
            if(PlayerInfo[playerid][pAccount] >= 0 && PlayerInfo[playerid][pAccount] =< 9){
            format(xxx, sizeof(xxx), "$0000000%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
            else if(PlayerInfo[playerid][pAccount] >= 10 && PlayerInfo[playerid][pAccount] =< 99){
            format(xxx, sizeof(xxx), "$000000%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
            else if(PlayerInfo[playerid][pAccount] >= 100 && PlayerInfo[playerid][pAccount] =< 999){
            format(xxx, sizeof(xxx), "$000000%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
            else if(PlayerInfo[playerid][pAccount] >= 1000 && PlayerInfo[playerid][pAccount] =< 9999){
            format(xxx, sizeof(xxx), "$00000%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
            else if(PlayerInfo[playerid][pAccount] >= 10000 && PlayerInfo[playerid][pAccount] =< 99999){
            format(xxx, sizeof(xxx), "$0000%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
            else if(PlayerInfo[playerid][pAccount] >= 100000 && PlayerInfo[playerid][pAccount] =< 999999){
            format(xxx, sizeof(xxx), "$000%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
            else if(PlayerInfo[playerid][pAccount] >= 1000000 && PlayerInfo[playerid][pAccount] =< 9999999){
            format(xxx, sizeof(xxx), "$00%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
            else if(PlayerInfo[playerid][pAccount] >= 10000000 && PlayerInfo[playerid][pAccount] =< 99999999){
            format(xxx, sizeof(xxx), "$0%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
            else if(PlayerInfo[playerid][pAccount] >= 100000000 && PlayerInfo[playerid][pAccount] =< 999999999){
            format(xxx, sizeof(xxx), "$%d", PlayerInfo[playerid][pAccount]);
            TextDrawSetString(TextdrawBank1[playerid], xxx);
            TextDrawHideForPlayer(playerid, TextdrawBank1[playerid]);
            TextDrawShowForPlayer(playerid, TextdrawBank1[playerid]);
            }
    }
This should do the trick. Think logicaly