Clearing Chat
#10

Quote:
Originally Posted by McCarthy
Посмотреть сообщение
That would not work for Rcon admin but normal players. Also I'm pretty sure 100 lines arent needed, 50 will do just fine. The GetPlayerName will also not work in the format. Correct code would be:
pawn Код:
CMD:cc(playerid, params[])
{
    new string[128], Name[25]; // This is the string what is lenght 128 letters, and a variable to store the name in
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xAFAFAFAA, "You are not authorized to use this command."); // This will check if you are rcon logged in
    GetPlayerName(playerid, Name, sizeof(Name)); //Storing the name into the Name variable we created
    for(new i=0; i<50; i++) // This will send a empty message 50 times to all players and it will clear the chat
    {
        SendClientMessageToAll(-1, "");
    }
    format(string, sizeof(string), "AdmWarning: %s has cleared the chat window.",Name); // This will show who cleared the chat (using the name variable to show the name we got earlier)
    SendClientMessageToAll(0xFFFF00AA, string); // This will send the message to all players
    return 1;
}
Also. Are you placing the commands outside callbacks?
Thanks a lot!. REP+ added.
Reply


Messages In This Thread
Clearing Chat - by RevolutionLite - 25.11.2012, 08:24
Re: Clearing Chat - by Laure - 25.11.2012, 08:30
Re: Clearing Chat - by leetboi - 25.11.2012, 08:31
Re: Clearing Chat - by RenSoprano - 25.11.2012, 08:36
Re: Clearing Chat - by RevolutionLite - 25.11.2012, 08:41
Re: Clearing Chat - by RenSoprano - 25.11.2012, 08:46
Re: Clearing Chat - by RevolutionLite - 25.11.2012, 08:49
Re: Clearing Chat - by McCarthy - 25.11.2012, 09:07
Re: Clearing Chat - by RenSoprano - 25.11.2012, 09:26
Re: Clearing Chat - by RevolutionLite - 25.11.2012, 14:59

Forum Jump:


Users browsing this thread: 1 Guest(s)