Textdraw showing respect.
#1

Hey, i have something like this for respect textdraw:

pawn Код:
Textdraw3 = TextDrawCreate(487.000000, 98.000000, "Respect:0");
TextDrawBackgroundColor(Textdraw3, 255);
TextDrawFont(Textdraw3, 1);
TextDrawLetterSize(Textdraw3, 0.519999, 1.600000);
TextDrawColor(Textdraw3, -1);
TextDrawSetOutline(Textdraw3, 1);
TextDrawSetProportional(Textdraw3, 1);
And how to change this to show me pRespect? I mean:

pawn Код:
PlayerInfo[playerid][pRespect]
Reply
#2

https://sampwiki.blast.hk/wiki/Format
Reply
#3

And? Lol.
Reply
#4

pawn Код:
new string[11];
format(string, sizeof(string), "%d", PlayerInfo[playerid][pRespect]);

Textdraw3 = TextDrawCreate(487.000000, 98.000000, string);
TextDrawBackgroundColor(Textdraw3, 255);
TextDrawFont(Textdraw3, 1);
TextDrawLetterSize(Textdraw3, 0.519999, 1.600000);
TextDrawColor(Textdraw3, -1);
TextDrawSetOutline(Textdraw3, 1);
TextDrawSetProportional(Textdraw3, 1);
Simple as that.
Reply
#5

Line:

pawn Код:
format(string, sizeof(string), "%d", PlayerInfo[playerid][pRespect]);
Error:

pawn Код:
error 017: undefined symbol "playerid"
Reply
#6

So do it other way around. Put TextDrawSetString wherever you show this TextDraw to the player.

pawn Код:
new string[11];
format(string, sizeof(string), "%d", PlayerInfo[playerid][pRespect]);

TextDrawSetString(Textdraw3, string);
Reply
#7

Show the textdrawshowforplayer line
Reply
#8

Okay, i created something like this:

pawn Код:
new string[30];
format(string, sizeof(string), "Respect:%d", PlayerInfo[playerid][pRespect]);
TextDrawSetString(Textdraw3, string);
TextDrawShowForPlayer(playerid, Textdraw3);
But it aint working. Why? Any ideas?
Reply
#9

pawn Код:
Textdraw3 = TextDrawCreate(487.000000, 98.000000, "Respect:0");
Make this string " " just in case. So replace "Respect:0" into " " (blank space). However check whether pRespect in the enum is an integer not a string.
Reply
#10

I already did that. Still not working.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)