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?