TextDraws
#1

I made some textdraws for points system and when they are exectuted .. its seems to work.. on my screen.. and it overlaps on friends screen.. it workd at very random.. sometimes it overlaps for me too.. it doesnt overlap for 3rd person.. but sometimes it does..
pawn Код:
//==============================================================================
// SCORING
//==============================================================================
    if(WarStart==1)
    {
            if(team[killerid]==1 && team[playerid]!=1)
            {
                MaxScore1++;
                new out[128];
                TextDrawHideForAll(Textdraw6);
                format(out,128,"~r~%i",MaxScore1);
                Textdraw6 = TextDrawCreate(580.000000, 309.000000, out);
                TextDrawLetterSize(Textdraw6, 0.509998, 1.299999);
                TextDrawShowForAll(Textdraw6);
               
            }
            if(team[killerid]==1 && team[playerid]==1)
            {
                MaxScore1--;
                new out[128];
                TextDrawHideForAll(Textdraw6);
                format(out,128,"~r~%i",MaxScore1);
                Textdraw6 = TextDrawCreate(580.000000, 309.000000, out);
                TextDrawLetterSize(Textdraw6, 0.509998, 1.299999);
                TextDrawShowForAll(Textdraw6);
            }
            if(team[killerid]==2 && team[playerid]!=2)
            {
                MaxScore2++;
                new out[128];
                TextDrawHideForAll(Textdraw8);
                format(out,128,"~b~%i",MaxScore2);
                Textdraw8 = TextDrawCreate(607.000000, 310.000000, out);
                TextDrawLetterSize(Textdraw8, 0.509998, 1.299999);
                TextDrawShowForAll(Textdraw8);
               
            }
            if(team[killerid]==2 && team[playerid]==2)
            {
                MaxScore2--;
                new out[128];
                TextDrawHideForAll(Textdraw8);
                format(out,128,"~b~%i",MaxScore2);
                Textdraw8 = TextDrawCreate(607.000000, 310.000000, out);
                TextDrawLetterSize(Textdraw8, 0.509998, 1.299999);
                TextDrawShowForAll(Textdraw8);
            }
            if(MaxScore1 == 10)
            {
                MaxRound1++;
                new out[128];
                TextDrawHideForAll(Textdraw9);
                format(out,128,"~r~%i",MaxRound1);
                Textdraw9 = TextDrawCreate(580.000000, 297.000000, out);
                TextDrawLetterSize(Textdraw9, 0.509998, 1.299999);
                TextDrawShowForAll(Textdraw9);
                TextDrawHideForAll(Textdraw8);
                TextDrawHideForAll(Textdraw6);
                Textdraw6 = TextDrawCreate(580.000000, 309.000000, "~r~0");
                Textdraw8 = TextDrawCreate(607.000000, 310.000000, "~b~0");
                TextDrawShowForAll(Textdraw6);
                TextDrawShowForAll(Textdraw8);
                MaxScore1=0;
                MaxScore2=0;
            }
            if(MaxScore2 == 10)
            {
                MaxRound2++;
                new out[128];
                TextDrawHideForAll(Textdraw11);
                format(out,128,"~b~%i",MaxRound2);
                Textdraw11 = TextDrawCreate(607.000000, 297.000000, out);
                TextDrawShowForAll(Textdraw11);
                TextDrawLetterSize(Textdraw11, 0.509998, 1.299999);
                TextDrawHideForAll(Textdraw8);
                TextDrawHideForAll(Textdraw6);
                Textdraw6 = TextDrawCreate(580.000000, 309.000000, "~r~0");
                Textdraw8 = TextDrawCreate(607.000000, 310.000000, "~b~0");
                TextDrawShowForAll(Textdraw6);
                TextDrawShowForAll(Textdraw8);
                MaxScore1=0;
                MaxScore2=0;
            }
            if(MaxRound1 == 3 || MaxRound2 == 3)
            {
                Victor();
            }
        }
   
    }
//==============================================================================
Reply
#2

Start with clicking this!
Reply
#3

how will it help ? its not a script request. i wanna know where im going wrong.. is it a famous issue ? or something ?
Reply
#4

Bump** Please i really need help in this
Reply
#5

Use TextDrawSetString instead of hiding the current textdraw - which is not the same as destroying it, by the way - and then making a new one. You'll run out of textdraws eventually and the server will crash.
Reply
#6

i used setstring its still overlapping..

Really need Help here people..
Reply
#7

BUmp_-
Reply
#8

Textdraws are overlapping because you never destroy them..

What I mean is that you should use TextDrawDestroy(); before you do TextDrawCreate(); again.

Example:

pawn Код:
if(team[killerid]==1 && team[playerid]!=1)
            {
                MaxScore1++;
                new out[128];
                TextDrawHideForAll(Textdraw6);
                format(out,128,"~r~%i",MaxScore1);
                TextDrawDestroy(Textdraw6); //<- this!
                Textdraw6 = TextDrawCreate(580.000000, 309.000000, out);
                TextDrawLetterSize(Textdraw6, 0.509998, 1.299999);
                TextDrawShowForAll(Textdraw6);
               
            }
OR:

Use TextDrawCreate in OnFilterScriptInit() or OnGameModeInit() then use TextDrawSetString();
Reply
#9

ahhhh.. thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)