SA-MP Forums Archive
My "ClearChat" callback isn't working. - 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: My "ClearChat" callback isn't working. (/showthread.php?tid=321377)



My "ClearChat" callback isn't working. - Guitar - 26.02.2012

Hello,

I've scripted this:

pawn Код:
forward ClearChat(playerid);
public ClearChat(playerid)
{
    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, "");
    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, "");
    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, "");
    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, "");
    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, "");
    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, "");
    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, "");
    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, "Clearing chat succeeded.");
    return 1;
}
And I put under OnPlayerConnect, ClearChat(playerid); but it didn't clear the chat. What should I do?

Thanks in advance.


Re: My "ClearChat" callback isn't working. - fiki574 - 26.02.2012

pawn Код:
stock ClearChat(playerid)
{
    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, "");
    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, "");
    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, "");
    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, "");
    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, "");
    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, "");
    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, "");
    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, "Clearing chat succeeded.");
    return 1;
}



Re: My "ClearChat" callback isn't working. - Guitar - 26.02.2012

It didn't work :S


Re: My "ClearChat" callback isn't working. - T0pAz - 26.02.2012

pawn Код:
stock ClearChat(playerid)
{
    for(new a = 0; a < 30; a++) // You should higher this because players can do /pagesize like mine is default at 30
    {
        SendClientMessage(playerid, 0xFFFFFFFF, " ");
    }
    return 1;
}



Re: My "ClearChat" callback isn't working. - Guitar - 26.02.2012

Thanks but still it didn't work


Re: My "ClearChat" callback isn't working. - T0pAz - 26.02.2012

Quote:
Originally Posted by Guitar
Посмотреть сообщение
Thanks but still it didn't work
Should work.


Re: My "ClearChat" callback isn't working. - Lorenc_ - 26.02.2012

Quote:
Originally Posted by T0pAz
Посмотреть сообщение
pawn Код:
stock ClearChat(playerid)
{
    for(new a = 0; a < 30; a++) // You should higher this because players can do /pagesize like mine is default at 30
    {
        SendClientMessage(playerid, 0xFFFFFFFF, " ");
    }
    return 1;
}
His code is faster though. And to fix the problem, insert a space.