Textdraw doesn't show. -
Face9000 - 09.06.2011
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.
Re: Textdraw doesn't show. -
Face9000 - 09.06.2011
BUMP
Re: Textdraw doesn't show. -
*IsBack - 09.06.2011
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?
Re: Textdraw doesn't show. -
Sascha - 09.06.2011
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)
Re: Textdraw doesn't show. -
Face9000 - 09.06.2011
No,the code of textdraw IS correct,i dont get ERRORS/WARNINGS when i compile it.Must be a position error maybe..?
Re: Textdraw doesn't show. -
0ne - 09.06.2011
Lol.... Of course it won't have any errors because of %s, just try to change it to %d.
Re: Textdraw doesn't show. -
Face9000 - 09.06.2011
:O Thanks
Now the textdraw shows lol.
Re: Textdraw doesn't show. -
*IsBack - 10.06.2011
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).