let me elighten you with this little example i put together.
PHP код:
#include <a_samp>
enum txInfo
{
Float:x,
Float:y,
text[43],//\0 + 24 Name + longest message i.e. " has dissconnected"
queueID//will decide at which position "textdraw" will be in queue
}
new textdraw[][txInfo] =
//setting some test data
{
{250.0, 350.0, "a", 4},
{250.0, 375.0, "b", 3},
{250.0, 400.0, "c", 2},
{250.0, 425.0, "d", 1}
};
main()
{
new i=0;
print("-initial state-");
for(; i<4; i++)//show initial
printf("QID: %d txt: %s",textdraw[i][queueID],textdraw[i][text]);
print("\n\n-Test run-");
for(i=0; i<4; i++)//testing it...
showConLog(), print("\n");
}
showConLog()
{
for(new i=0; i<4; i++)
{
if(!(textdraw[i][queueID]%4))//this one reached the top & is going to the bottom now (% -> modulo)
textdraw[i][queueID]=1;//could also add a new message here
else
textdraw[i][queueID]++;
}
for(new i=3; i>-1; i--)
printf("QID: %d txt: %s",textdraw[textdraw[i][queueID]-1][queueID],textdraw[textdraw[i][queueID]-1][text]);
}
nice and simple, it'll move the
"textdraws
" bottom-top
and then again bottom-top
it'll print this
Код:
-initial state-
QID: 4 txt: a
QID: 3 txt: b
QID: 2 txt: c
QID: 1 txt: d
-Test run-
QID: 4 txt: b
QID: 3 txt: c
QID: 2 txt: d
QID: 1 txt: a
QID: 4 txt: c
QID: 3 txt: d
QID: 2 txt: a
QID: 1 txt: b
QID: 4 txt: d
QID: 3 txt: a
QID: 2 txt: b
QID: 1 txt: c
QID: 4 txt: a
QID: 3 txt: b
QID: 2 txt: c
QID: 1 txt: d
if you follow the "a"
"textdraws
",
you can see it moves from the top to the 1st sopt at the bottom
and is making its way back to the top from there.
once it reaches the top, it'll all start over again and again and again...
if youdid understand the logic here, you can easily do this.
all you would have to do is change the Y position of the textdraw
along with it's queue ID (which you've set when creating your 4 log textdraws)
obviously there are a lot of different approaches you can take with this,
but this is just what came to my mind first