What's wrong
#5

pawn Код:
new
        szTextdrawMessage[12],
        Text: tTextdraw; // this needs to be a global variable
       
    tTextdraw = TextDrawCreate(276.000000, 391.000000, "Score: 0");
    TextDrawBackgroundColor(tTextdraw, 255);
    TextDrawFont(tTextdraw, 1);
    TextDrawLetterSize(tTextdraw, 0.500000, 1.799999);
    TextDrawColor(tTextdraw, -1);
    TextDrawSetOutline(tTextdraw, 0);
    TextDrawSetProportional(tTextdraw, 0);
    TextDrawSetShadow(tTextdraw, 1);
   
    format(szTextdrawMessage, sizeof(szTextdrawMessage), "Score: %d", GetPlayerScore(playerid));
    TextDrawSetString(tTextdraw, szTextdrawMessage);
    TextDrawShowForPlayer(playerid, tTextdraw);
You can't show the textdraw before you've set the effects and expect them to show, plus your code was generally illogical and a complete mess - this changed code will set the score to 0 in the textdraw then get the real score once the textdraw has been made and will show it to the player.

You want to show the score to a player or update it, use this code:
pawn Код:
new
        szTextdrawMessage[12];

    format(szTextdrawMessage, sizeof(szTextdrawMessage), "Score: %d", GetPlayerScore(playerid));
    TextDrawSetString(tTextdraw, szTextdrawMessage);
    TextDrawShowForPlayer(playerid, tTextdraw);
Reply


Messages In This Thread
What's wrong - by Face9000 - 01.06.2011, 08:47
Re: What's wrong - by Hobod - 01.06.2011, 08:52
Re: What's wrong - by Face9000 - 01.06.2011, 08:59
Re: What's wrong - by Hobod - 01.06.2011, 09:02
Re: What's wrong - by Calgon - 01.06.2011, 09:07
Re: What's wrong - by Biesmen - 01.06.2011, 09:09
Re: What's wrong - by Unknown_Killer - 01.06.2011, 09:09
Re: What's wrong - by Calgon - 01.06.2011, 09:11
Re: What's wrong - by Biesmen - 01.06.2011, 09:13
Re: What's wrong - by Calgon - 01.06.2011, 09:13

Forum Jump:


Users browsing this thread: 2 Guest(s)