SA-MP Forums Archive
Textdraw doesn't show. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Textdraw doesn't show. (/showthread.php?tid=260496)



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).