TextDraw problems
#1

Hello, recently I involved in making game mode...Basically it is TDM on RC Battle field map(interior 10).

I was thinking how to show current score, and i figured out you can do it with TextDraws.

Since me and TextDraw don't get along well...i need help.

I want to place TextDraw on left(like in screen shot below), and want it to display current points for both team(USA and Vietnam).

Screen shot

So far i got to this:

These are score variables.
pawn Code:
new USAscore = 0;
new VIETNAMscore = 0;
And this is OnPlayerConnect()
pawn Code:
new Text:textDraw;
textDraw = TextDrawCreate(i dont know, the co-ordinates,"nor what to put here");
TextDrawShowForPlayer(playerid,textDraw);
If you can help me to make something like this, i would be really grateful.
Reply
#2

you need to create a textdraw then show for all..

make a timer thath update every time the textdraw and score

use some textdraw ingame editors for do the textdraw and u are done ^^
Reply
#3

Alright, i made this now:

pawn Code:
Textdraw0 = TextDrawCreate(2.000000,249.000000,"USA:");
Textdraw1 = TextDrawCreate(1.000000,271.000000,"Vietnam:");
Textdraw2 = TextDrawCreate(62.000000,249.000000, USAscore);
Textdraw3 = TextDrawCreate(62.000000,271.000000, VIETNAMscore);
And when i compile it i got these 2 errors on both lines(textdraw3 and textdraw2):

Code:
error 035: argument type mismatch (argument 3)
Also, i need help with "updating" scores. Example:

Image that USA team have score 23, and Vietnam have 24. Now when player1(USA) kills player2(Vietnam), TextDraw2 shows 24 instead of 23.
Reply
#4

Third parameter in TextDrawCreate has to be a string.

pawn Code:
new string[4];
format(string, sizeof(string), "%d", USAscore);
Textdraw2 = TextDrawCreate(62.000000, 249.000000, string);
For updating the textdraw, you might want to check TextDrawSetString.
Reply
#5

Now i got the first part, now if somebody can explain me TextDrawSetString.

Correct me If I'm wrong in this:
pawn Code:
if(gTeam[killerid] == TEAM_USA)
{
USAscore++;
TextDrawSetString(Textdraw2, string);
}
This is OnPlayerDeath()
Reply
#6

You have to format the string (just like you did when creating the draw).
Reply
#7

Alright, thanks, i Think I'll handle it.
Reply
#8

do you mean this? << clicky clicky
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)