SA-MP Forums Archive
Textdraws Returns - 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: Textdraws Returns (/showthread.php?tid=274175)



Textdraws Returns - 0_o - 04.08.2011

How To Make It Like That If Player Is Seeing 1 Textdraw The Other Goes Automatically Down Of It Not On Top Of It ~n~?


Re: Textdraws Returns - 0_o - 04.08.2011

Anyone?


Re: Textdraws Returns - sleepysnowflake - 04.08.2011

I do not understand what you are looking for.


Re: Textdraws Returns - fie - 04.08.2011

Can you say again in more detail?
You mean when there is a text draw showing you want another one to hide?


Re: Textdraws Returns - 0_o - 04.08.2011

No. I Mean If One Textdraw Is Show At 1 Pos. The Other One Goes Down Of It. Not On The Same Pos So It Won't Mix Up.


Re: Textdraws Returns - 0_o - 04.08.2011

Anyone Who Can Help Me?


Re: Textdraws Returns - [P4] - 04.08.2011

You mean same like chatbox is working? I have no idea, I would like to know as well


AW: Textdraws Returns - Nero_3D - 04.08.2011

you could destroy and recreate a little more down

but thats mostly not needed

just create the textdraws at different positions

and set the data to the correct one, move the data to the next lower one if the first is needed


Here a little example

First we create our textdraws
pawn Код:
new Text: TextDraw[3];

//OnGameModeInit
    for(new i, Float: offset = 0.0; i != sizeof TextDraw; ++i, offset += 10.0) {
        TextDraw[i] = TextDrawCreate(30.0, 50.0 + offset, "_");
    }
Second we write a function which puts the new data always in the first one
pawn Код:
stock TextDrawSetData(string[]) {
    enum E_TextdrawData {
        tText[256] //only 256 because over that you cant use ~r~, ...
    }
    static TextDrawData[sizeof TextDraw][E_TextdrawData];

    if(string[0] != EOS) {
        new i = sizeof TextDraw;
        while(--i != 0) {
            TextDrawData[i][tText] = TextDrawData[i - 1][tText];
            TextDrawSetString(TextDraw[i], TextDrawData[i][tText]);
        }
        TextDrawData[0][tText][0] = EOS;
        TextDrawSetString(TextDraw[0], string);
        strcat(TextDrawData[0][tText], string, 256);
    }
}



Re: AW: Textdraws Returns - 0_o - 06.08.2011

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
you could destroy and recreate a little more down

but thats mostly not needed

just create the textdraws at different positions

and set the data to the correct one, move the data to the next lower one if the first is needed


Here a little example

First we create our textdraws
pawn Код:
new Text: TextDraw[3];

//OnGameModeInit
    for(new i, Float: offset = 0.0; i != sizeof TextDraw; ++i, offset += 10.0) {
        TextDraw[i] = TextDrawCreate(30.0, 50.0 + offset, "_");
    }
Second we write a function which puts the new data always in the first one
pawn Код:
stock TextDrawSetData(string[]) {
    enum E_TextdrawData {
        tText[256] //only 256 because over that you cant use ~r~, ...
    }
    static TextDrawData[sizeof TextDraw][E_TextdrawData];

    if(string[0] != EOS) {
        new i = sizeof TextDraw;
        while(--i != 0) {
            TextDrawData[i][tText] = TextDrawData[i - 1][tText];
            TextDrawSetString(TextDraw[i], TextDrawData[i][tText]);
        }
        TextDrawData[0][tText][0] = EOS;
        TextDrawSetString(TextDraw[0], string);
        strcat(TextDrawData[0][tText], string, 256);
    }
}
So That Acutally Works As Chatbox Right?


AW: Re: AW: Textdraws Returns - Nero_3D - 06.08.2011

Quote:
Originally Posted by 0_o
Посмотреть сообщение
So That Acutally Works As Chatbox Right?
Yes that would work

But the main problem of such a chatbox would be that you cant send privat data

For that you would need an extra system