Clear Chat
#3

I have re-coded the way you clear the chat, The chat is only cleared out for players [not Admins].

Note; I am not sure if you are using foreach, So i have used a standard player looping on this code, This is a bad method. Use foreach.

PHP код:
COMMAND:clearchat(playeridparams[])
{
    if(
playerData[playerid][playerLoggedIn])
    {
        if(
playerData[playerid][playerLevel] >= 3)
        {
            for(new 
i=0i<MAX_PLAYERSi++)
            {
                if(
IsPlayerConnected(i))
                {
                    if(
playerData[i][playerLevel] == 0)
                    {
                        for(new 
050x++)
                        {
                            
SendClientMessage(iCOLOR_WHITE," ");
                        }
                    }
                }
            }
            
SendClientMessageToAll(COLOR_WHITE"{A9C4E4}An administrator has cleared the chat.");
            new 
log[250];
            
format(logsizeof(log), "%s(%i) cleared the chat"playerData[playerid][tempAdminName], playerid);
            
SendAdminText(playeridlog);
        }
    }
    else
    {
        
SendClientMessage(playeridCOLOR_WHITE"{B7B7B7}[SERVER] {FFFFFF}You must be logged in to use commands.");
    }
    return 
1;

Reply


Messages In This Thread
Clear Chat - by whatreally - 18.12.2015, 11:52
Re: Clear Chat - by FreAkeD - 18.12.2015, 12:00
Re: Clear Chat - by JaKe Elite - 18.12.2015, 12:09
Re: Clear Chat - by whatreally - 18.12.2015, 12:15

Forum Jump:


Users browsing this thread: 2 Guest(s)