Clear Chat Information.
#1

Hello community,

I want to know that is there any function like ClearChat(playerid) ? Or ClearPlayerChat(playerid)?

I have this under clear chat command:

pawn Код:
SendClientMessageToAll(0xDEEE20FF, " ");
    SendClientMessageToAll(0xDEEE20FF, " ");
    SendClientMessageToAll(0xDEEE20FF, " ");
    SendClientMessageToAll(0xDEEE20FF, " ");
    SendClientMessageToAll(0xDEEE20FF, " ");
    SendClientMessageToAll(0xDEEE20FF, " ");
    SendClientMessageToAll(0xDEEE20FF, " ");
    SendClientMessageToAll(0xDEEE20FF, " ");
    SendClientMessageToAll(0xDEEE20FF, " ");
    SendClientMessageToAll(0xDEEE20FF, " ");

but they can scroll and can see messages again, i want to remove previous all messages completely.
Thanks,

Anak - Member
Reply
#2

A better way would be to use somthing like this:

pawn Код:
for(new i = 0; i < 50; i++) SendClientMessageToAll(COLOR_WHITE, " "); return 1; //For clearing all players chat.
for(new i = 0; i < 50; i++) SendClientMessage(playerid, COLOR_WHITE, " "); return 1; //For clearing a certain player's chat.
I'm not sure how many lines of message SA-MP currently holds, but you can count them and then replace the 50's with the number of lines.
Reply
#3

Here's the full code:
Код:
for(new i = 0; i < 90; i++)
SendClientMessageToAll(-1," ");
You can add a string telling players an admin has cleared the chat ...etc
Reply
#4

pawn Код:
CMD:clearchat(playerid, params[])
{
    for(new i=0;i<150;i++)
    {
        SendClientMessageToAll(playerid, -1, "  ");
    }
    return 1;
}
^If you use ZCMD.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)