Clearchat at Login
#1

Hello.. Basically, When people login, you can see the this..
Connected. Joining Server.
Audio Stream: ..........
And because of that, I cant see the textdraws, can someone tell me how to clearchat when player joins.

thank you.
Reply
#2

Completely clear the chat for a player?

pawn Код:
forward ClearChat(playerid);
public ClearChat(playerid)
{
        SendClientMessage(playerid, 0xFFFFFFFF, " ");
        SendClientMessage(playerid, 0xFFFFFFFF, " ");
        SendClientMessage(playerid, 0xFFFFFFFF, " ");
        SendClientMessage(playerid, 0xFFFFFFFF, " ");
        SendClientMessage(playerid, 0xFFFFFFFF, " ");
        SendClientMessage(playerid, 0xFFFFFFFF, " ");
        SendClientMessage(playerid, 0xFFFFFFFF, " ");
        SendClientMessage(playerid, 0xFFFFFFFF, " ");
        SendClientMessage(playerid, 0xFFFFFFFF, " ");
        SendClientMessage(playerid, 0xFFFFFFFF, " ");
        SendClientMessage(playerid, 0xFFFFFFFF, " ");
        SendClientMessage(playerid, 0xFFFFFFFF, " ");
        return 1;
}
Place ClearChat(playerid); after the line that plays the music on connect.
Reply
#3

Use a loop

pawn Код:
for(new j = 0; j < 100; j++)
{
     SendClientMessage(playerid, -1, "");
}
I hope I helped any feedback would be appreciated!
Reply
#4

//EDIT: lol... slow

just send empty messages to "clear" it once they get to the login/register dialog

pawn Код:
for(new i = 0; i < 100; i++) SendClientMessage(playerid,-1, "\n");
100 is the max here, you can't view more than 100 lines in chat.
Reply
#5

pawn Код:
stock ClearChat(playerid, lines = 20)
{
    for(new i = 0; i != lines; ++i)
    {
        SendClientMessage(playerid, -1, "");
    }
}

stock ClearChatForAll(lines = 20)
{
    for(new i = 0; i != lines; ++i)
    {
        SendClientMessageToAll(-1, "");
    }
}
Reply
#6

Thanks all! Problem has been solved.. I need help with something else.. Please look in the scripting help section!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)