Clear chat only for players
#1

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;
}
Reply
#2

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

thanks bro rep+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)