Clearchat
#1

How can i do this?
Reply
#2

Send empty chat lines till the chat is filled.
Reply
#3

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

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.
Reply
#5

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

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;
}
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)