textdraw problem
#1

ok when i use the cmd to set the textdraw's string, the textdraw it shows a red text saying "lol" then hides the textdraw

pawn Код:
new Text:AnnounceTextDraw;
new Announced=0;
//ongamemodeinit
pawn Код:
TextDrawDestroy(AnnounceTextDraw);
//one second timer
pawn Код:
if(Announced >= 1)Announced --;
        if(Announced == 0){
            Announced =0;
            TextDrawHideForAll(AnnounceTextDraw);
        }
pawn Код:
CMD:announce(playerid,params[])
{
    if(PlayerInfo[playerid][AdminLevel] == 0) return 0;
    new NewAnn[110];
    if(sscanf(params, "s[110]", NewAnn)) return SendClientMessage(playerid,0xFF0000AA,"USAGE: /Announce <text>");

    TextDrawSetString(AnnounceTextDraw,NewAnn);
    TextDrawShowForAll(AnnounceTextDraw);
    Announced = 7;
    return 1;
}
pawn Код:
AnnounceTextDraw = TextDrawCreate(315.000000, 210.000000, "Announcement");
    TextDrawAlignment(AnnounceTextDraw, 2);
    TextDrawBackgroundColor(AnnounceTextDraw, 255);
    TextDrawFont(AnnounceTextDraw, 3);
    TextDrawLetterSize(AnnounceTextDraw, 0.529999, 2.499999);
    TextDrawColor(AnnounceTextDraw, -1);
    TextDrawSetOutline(AnnounceTextDraw, 1);
    TextDrawSetProportional(AnnounceTextDraw, 1);
Reply
#2

It must be something else in your code causing the problem if it displays "lol" because that word isn't in the code you posted. Also a little pointless code there like the second timer "if(Announced == 0) Announced =0;" (pointless).
Reply
#3

ok changed it to
pawn Код:
if(Announced >= 2)Announced --;
        if(Announced == 1){
            Announced =0;
            TextDrawHideForAll(AnnounceTextDraw);
        }
but now its showing the red text ( its showing w/e i type for params now) then hides after about 500 miliseconds
Reply
#4

bump still inneed of this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)