Textdraw doesn't show.
#1

Hi guys,i've created some dynamic textdraw,no problems when compile,but i can't see that.

new Text:UKD;

OnGameModeInit:

pawn Код:
UKD = TextDrawCreate(496.000000, 225.000000, "Usa kills:");
    TextDrawBackgroundColor(UKD, 255);
    TextDrawFont(UKD, 1);
    TextDrawLetterSize(UKD, 0.480000, 1.699999);
    TextDrawColor(UKD, 65535);
    TextDrawSetOutline(UKD, 0);
    TextDrawSetProportional(UKD, 1);
    TextDrawSetShadow(UKD, 1);
OnPlayerConnect

pawn Код:
new ukills[128];
    format(ukills, sizeof(ukills), "Usa Kills: %s", UsaKills);
    TextDrawSetString(UKD, ukills);
    TextDrawShowForAll(UKD);
I've defined all variables for UsaKills,i've only the problem that textdraw doesn't show ingame.
Reply
#2

BUMP
Reply
#3

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
BUMP
(3 hours bump is not allowed)

First of all, this:
TextDrawShowForAll(UKD);
Should go OnGameModeInit() callback.
Maybe the position is out of screen or something?
And in this line:
format(ukills, sizeof(ukills), "Usa Kills: %s", UsaKills);
what's UsaKills? Can you show how you format it?
Reply
#4

Quote:
Originally Posted by *IsBack
Посмотреть сообщение
(3 hours bump is not allowed)

First of all, this:
TextDrawShowForAll(UKD);
Should go OnGameModeInit() callback.
Maybe the position is out of screen or something?
And in this line:
format(ukills, sizeof(ukills), "Usa Kills: %s", UsaKills);
what's UsaKills? Can you show how you format it?
you have no clue about textdraws, do you?

the "TextDrawShowForAll" is totally correct at the place where it is....
and for the format line, this could actually be the problem.. the "UsaKills" seems to be an integer variable (if I'm right).,,
try changing it to "format(ukills, sizeof(ukills), "Use Kills, %d", UsaKills);" (%d is the variable for integer variables - %s is for strings)
Reply
#5

No,the code of textdraw IS correct,i dont get ERRORS/WARNINGS when i compile it.Must be a position error maybe..?
Reply
#6

Lol.... Of course it won't have any errors because of %s, just try to change it to %d.
Reply
#7

:O Thanks Now the textdraw shows lol.
Reply
#8

Quote:
Originally Posted by Sascha
Посмотреть сообщение
you have no clue about textdraws, do you?

the "TextDrawShowForAll" is totally correct at the place where it is....
and for the format line, this could actually be the problem.. the "UsaKills" seems to be an integer variable (if I'm right).,,
try changing it to "format(ukills, sizeof(ukills), "Use Kills, %d", UsaKills);" (%d is the variable for integer variables - %s is for strings)
TextDrawShowForAll - shows the textdraw to all players. He has it under OnPlayerConnect, so when player joins, this will show textdraw to all players (even for those who already see it). Either this should be changed to TextDrawShowForPlayer, or should go to some command (yes, I was wrong about OnGameModeInit, cause it will show up for connected players, and that is 0 when that callback gets called).
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)