Clearchat at Login - 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)
+--- Thread: Clearchat at Login (
/showthread.php?tid=529684)
Clearchat at Login -
Jigsaw123 - 03.08.2014
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.
Re: Clearchat at Login -
Rifa4life - 03.08.2014
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.
Re: Clearchat at Login -
Stanford - 03.08.2014
Use a loop
pawn Код:
for(new j = 0; j < 100; j++)
{
SendClientMessage(playerid, -1, "");
}
I hope I helped any feedback would be appreciated!
Re: Clearchat at Login -
CutX - 03.08.2014
//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.
Re: Clearchat at Login -
iFarbod - 03.08.2014
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, "");
}
}
Re: Clearchat at Login -
Jigsaw123 - 03.08.2014
Thanks all! Problem has been solved.. I need help with something else.. Please look in the scripting help section!