Textdraw string
#1

was looking tutorial here TextDraw string but not by setting the score etc is no number



pawn Код:
forward UpdateTimer();
public UpdateTimer()
{

       for(new x; x<MAX_PLAYERS; x++) // Loop for all players
       {
       new TDstring[128], Score = GetPlayerScore(x), Money = GetPlayerMoney(x), Ping = GetPlayerPing(x);
       if(!IsPlayerConnected(x))
       {
       format(TDstring, sizeof(TDstring), "SCORE %d, DINHEIRO %d, KILLS %d, DEATHS %d, FPS %d, PING %d", Score, Money,PlayerInfo[id][Kills],PlayerInfo[id][Deaths],Ping);
       TextDrawSetString(Textdraw[0][x], TDstring);
       }
       }
       return 1;
}




pawn Код:
SetTimer("UpdateTimer", 1000, true);
    ShowPlayerMarkers(PLAYER_MARKERS_MODE_GLOBAL);
    for(new i=0; i<GetMaxPlayers(); i++)
    {
    Textdraw[0][i] = TextDrawCreate(641.375000, 429.666687, "usebox"); //OBS: Textdraw[0] e Nгo Textdraw0 Entendeu ?
    TextDrawLetterSize(Textdraw[0][i], 0.000000, 1.822222);
    TextDrawTextSize(Textdraw[0][i], -2.000000, 0.000000);
    TextDrawAlignment(Textdraw[0][i], 1);
    TextDrawColor(Textdraw[0][i], 0);
    TextDrawUseBox(Textdraw[0][i], true);
    TextDrawBoxColor(Textdraw[0][i], 102);
    TextDrawSetShadow(Textdraw[0][i], 0);
    TextDrawSetOutline(Textdraw[0][i], 0);
    TextDrawFont(Textdraw[0][i], 0);

    Textdraw[1][i] = TextDrawCreate(4.375000, 429.916687, "SCORE:");
    TextDrawLetterSize(Textdraw[1][i], 0.449999, 1.600000);
    TextDrawAlignment(Textdraw[1][i], 1);
    TextDrawColor(Textdraw[1][i], -2139062017);
    TextDrawSetShadow(Textdraw[1][i], 0);
    TextDrawSetOutline(Textdraw[1][i], 1);
    TextDrawBackgroundColor(Textdraw[1][i], 51);
    TextDrawFont(Textdraw[1][i], 3);
    TextDrawSetProportional(Textdraw[1][i], 1);

    Textdraw[2][i] = TextDrawCreate(110.000000, 430.500030, "DINHEIRO:");
    TextDrawLetterSize(Textdraw[2][i], 0.449999, 1.600000);
    TextDrawAlignment(Textdraw[2][i], 1);
    TextDrawColor(Textdraw[2][i], -2139062017);
    TextDrawSetShadow(Textdraw[2][i], 0);
    TextDrawSetOutline(Textdraw[2][i], 1);
    TextDrawBackgroundColor(Textdraw[2][i], 51);
    TextDrawFont(Textdraw[2][i], 3);
    TextDrawSetProportional(Textdraw[2][i], 1);

    Textdraw[3][i] = TextDrawCreate(225.625000, 430.499969, "KILLS:");
    TextDrawLetterSize(Textdraw[3][i], 0.449999, 1.600000);
    TextDrawAlignment(Textdraw[3][i], 1);
    TextDrawColor(Textdraw[3][i], -2139062017);
    TextDrawSetShadow(Textdraw[3][i], 0);
    TextDrawSetOutline(Textdraw[3][i], 1);
    TextDrawBackgroundColor(Textdraw[3][i], 51);
    TextDrawFont(Textdraw[3][i], 3);
    TextDrawSetProportional(Textdraw[3][i], 1);

    Textdraw[4][i] = TextDrawCreate(314.375000, 430.500152, "DEATHS:");
    TextDrawLetterSize(Textdraw[4][i], 0.449999, 1.600000);
    TextDrawAlignment(Textdraw[4][i], 1);
    TextDrawColor(Textdraw[4][i], -2139062017);
    TextDrawSetShadow(Textdraw[4][i], 0);
    TextDrawSetOutline(Textdraw[4][i], 1);
    TextDrawBackgroundColor(Textdraw[4][i], 51);
    TextDrawFont(Textdraw[4][i], 3);
    TextDrawSetProportional(Textdraw[4][i], 1);

    Textdraw[5][i] = TextDrawCreate(415.625000, 429.916564, "FPS:");
    TextDrawLetterSize(Textdraw[5][i], 0.449999, 1.600000);
    TextDrawAlignment(Textdraw[5][i], 1);
    TextDrawColor(Textdraw[5][i], -2139062017);
    TextDrawSetShadow(Textdraw[5][i], 0);
    TextDrawSetOutline(Textdraw[5][i], 1);
    TextDrawBackgroundColor(Textdraw[5][i], 51);
    TextDrawFont(Textdraw[5][i], 3);
    TextDrawSetProportional(Textdraw[5][i], 1);

    Textdraw[6][i] = TextDrawCreate(488.125000, 429.333312, "PING:");
    TextDrawLetterSize(Textdraw[6][i], 0.449999, 1.600000);
    TextDrawAlignment(Textdraw[6][i], 1);
    TextDrawColor(Textdraw[6][i], -2139062017);
    TextDrawSetShadow(Textdraw[6][i], 0);
    TextDrawSetOutline(Textdraw[6][i], 1);
    TextDrawBackgroundColor(Textdraw[6][i], 51);
    TextDrawFont(Textdraw[6][i], 3);
    TextDrawSetProportional(Textdraw[6][i], 1);
    }


pawn Код:
public OnPlayerConnect(playerid)
for(new i = 0; i < 7; i++) TextDrawShowForPlayer(playerid, Textdraw[i][playerid]);
Reply
#2

That:

if(!IsPlayerConnected(x))

is not correct.

Should be: if(IsPlayerConnected(x))


and creating the textdraw's by that way is not correct you should use Player Textdraw.
Reply
#3

the result looks as image and be textdraw is under the hud


Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)