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



Clearchat - Ihsan_Cingisiz - 04.06.2010

How can i do this?


Re: Clearchat - ettans - 04.06.2010

Send empty chat lines till the chat is filled.


Re: Clearchat - Ihsan_Cingisiz - 04.06.2010

Quote:
Originally Posted by ettans
Send empty chat lines till the chat is filled.
But can't i do it with RCONCOMMAND(?


Re: Clearchat - Bomber - 04.06.2010

pawn Код:
if(strcmp(cmd, "/clearchat", true) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, "");
return 1;
}
If you want, that only admin can use that then add your admin level lines.


Re: Clearchat - cessil - 04.06.2010

well from memory there's 100 lines so you'd do this instead
Код:
for(new chat = 0; chat <= 100; chat++)
  {
		SendClientMessageToAll(GREEN," ");
  }



Re: Clearchat - CuervO - 04.06.2010

pawn Код:
forward ClearChat(lines); // forward the function

public ClearChat(lines) // create it
{
    for(new i = 0; i < lines; i++) // with a loop to check the lines.
    {
        SendClientMessageToAll(0xFFFFFFFF," "); // send the message
    }
}
Example Use, this will clear everyone's chat

pawn Код:
if(strcmp(cmd, "/cc", true) == 0)
{
    if(IsPlayerAdmin(playerid)) // change it to whatever you have, else it will only work for rcon
    {
        ClearChat(100);
    }
    return 1;
}



Re: Clearchat - On_Top_Non_Stop - 04.06.2010

Id just like to point out there is only 50 lines in the chat