01.06.2011, 09:07
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 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);