14.02.2015, 13:58
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?
ClearChatBoxToAll function.
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; }
Код:
public ClearChatboxToAll(playerid, lines) { if (IsPlayerConnected(playerid)) { for(new i=0; i<lines; i++) { SendClientMessageToAll(COLOR_GREY, " "); } } return 1; }