SA-MP Forums Archive
TextDraw Won'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 Won't Show! (/showthread.php?tid=277199)



TextDraw Won't Show! - Tigerbeast11 - 16.08.2011

Under OnGameModeInIt():
pawn Код:
Scores = TextDrawCreate(150,450,"Loading Values");
    new tmpstr[250];//Accommodate for string size
    format(tmpstr,sizeof(tmpstr),"Grove:%d  Ballas:%d  Vagos:%d  Azteca:%d  Mafia:%d",GScores,BScores,VScores,AScores,MScores);
    TextDrawSetString(Scores,tmpstr);
    TextDrawFont(Scores,1);
    TextDrawLetterSize(Scores,0.3,2.1);
    TextDrawColor(Scores,GREY);
    TextDrawSetOutline(Scores,0);
    TextDrawSetProportional(Scores,1);
    TextDrawSetShadow(Scores,0);
    TextDrawUseBox(Scores,1);
    TextDrawBoxColor(Scores,BLACK);
Under OnPlayerSpawn(playerid):
pawn Код:
TextDrawShowForPlayer(playerid,Scores);
I don't get any errors but the text draw doesn't show!


Re: TextDraw Won't Show! - Backwardsman97 - 16.08.2011

You don't get any errors. Do you get any warnings? Make sure you're declaring scores with the 'text' tag.


Re: TextDraw Won't Show! - Tigerbeast11 - 16.08.2011

Nope, no warnings or errors.

At the top, I have dfined it:
pawn Код:
new Text:Scores;



Re: TextDraw Won't Show! - iPLEOMAX - 16.08.2011

Maybe try a different TextDraw Colour...?

Try this: TextDrawColor(Scores, 16711935);


Re: TextDraw Won't Show! - Tigerbeast11 - 17.08.2011

No, I tried a differnt colour... Still not working


Re: TextDraw Won't Show! - Mozz - 17.08.2011

you should try making a function like

CreatePlayerTextdraws( playerid )

then adding all your textdraws there, makes thing so much easier


Re: TextDraw Won't Show! - Tigerbeast11 - 17.08.2011

Yes, that would clear things up a bit... Do you have any idea on how I could fix this?


Re: TextDraw Won't Show! - Mozz - 17.08.2011

try creating it under onplayerconnect


Re: TextDraw Won't Show! - Tigerbeast11 - 17.08.2011

Still doesnt work :/


Re: TextDraw Won't Show! - Mozz - 17.08.2011

pawn Код:
CreatePlayerTextdraws (playerid)
{
    Scores[playerid] = TextDrawCreate(150,450,"Loading Values");
    new tmpstr[250];//Accommodate for string size
    format(tmpstr,sizeof(tmpstr),"Grove:%d Ballas:%d Vagos:%d Azteca:%d Mafia:%d",GScores,BScores,VScores,AScores,MScores);
    TextDrawSetString(Scores[playerid],tmpstr);
    TextDrawFont(Scores[playerid],1);
    TextDrawLetterSize(Scores[playerid],0.3,2.1);
    TextDrawColor(Scores[playerid],GREY);
    TextDrawSetOutline(Scores[playerid],0);
    TextDrawSetProportional(Scores[playerid],1);
    TextDrawSetShadow(Scores[playerid],0);
    TextDrawUseBox(Scores[playerid],1);
    TextDrawBoxColor(Scores[playerid],BLACK);
    return 1;
}
under ongamemodeinit

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
CreatePlayerTextdraws(i)
}
don't know if this works but i guess you got nothing to lose in testing it.