SA-MP Forums Archive
Clear chat only for players - 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: Clear chat only for players (/showthread.php?tid=563179)



Clear chat only for players - TiXz0r - 14.02.2015

I have cmd /cc for clear chat, but i want only clear chat for players, not for admins.

but i dont know how do this?


Код:
CMD:cc(playerid, params[])
{
    if(IsLogged[playerid] == false) return SendClientMessage(playerid, COLOR_RED, ""COL_ORANGE"HF-Protect | "COL_WHITE"Moras biti ulogiran kako bi mogao koristiti "COL_CYAN"komande"COL_RED"!");
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "[GRESKA]: "COL_WHITE"Nemas prava za koristenje ove komande.");
	if(gaDuty[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "[GRESKA]: "COL_WHITE"Nisi na Admin duznosti.");
	else
	{
	    new string[248], sendername[MAX_PLAYER_NAME];
	    GetPlayerName(playerid, sendername, sizeof(sendername));
	    
		ClearChatboxToAll(playerid,100);
		
		format(string, sizeof(string),""COL_ORANGE"[SERVER]: "COL_WHITE"Admin %s je ocistio chat.", sendername);
		SendClientMessageToAll(COLOR_RED,string);
		
		SendClientMessage(playerid, COLOR_GREY, ""COL_ORANGE"[SERVER]: "COL_WHITE"Ocistio si Chat.");
	}
	return 1;
}
ClearChatBoxToAll function.

Код:
public ClearChatboxToAll(playerid, lines)
{
	if (IsPlayerConnected(playerid))
	{
		for(new i=0; i<lines; i++)
		{
			SendClientMessageToAll(COLOR_GREY, " ");
		}
	}
	return 1;
}



Re: Clear chat only for players - Nixco - 14.02.2015

pawn Код:
public ClearChatboxToAll(playerid, lines)
{
    if (IsPlayerConnected(playerid) && PlayerInfo[playerid][pAdmin] < 1)
    {
        for(new i=0; i<lines; i++)
        {
            SendClientMessageToAll(COLOR_GREY, " ");
        }
    }
    return 1;
}



Re: Clear chat only for players - TiXz0r - 14.02.2015

thanks bro rep+