15.04.2014, 00:35
Код:
CMD:hc(playerid, params[]) { new string[128]; if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(!PlayerInfo[playerid][pHelper] && !PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command."); if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /hc [text]"); if(AntiAdv(playerid, params)) return 1; if(PlayerInfo[playerid][pHelper] || PlayerInfo[playerid][pAdmin]) format(string, sizeof(string), "** %s %s: %s", RPHLN(playerid), RPN(playerid), params); foreach(Player, i) { if(IsPlayerLoggedIn(i)) { if(PlayerInfo[i][pHelper] || PlayerInfo[i][pAdmin]) { SendClientMessage(i, COLOR_LIME, string); } } } // Logs if(PlayerInfo[playerid][pHelper] && !PlayerInfo[playerid][pAdmin]) format(string, sizeof(string), "*%s %s: %s", RPHLN(playerid), RPN(playerid), params); else if(!PlayerInfo[playerid][pHelper] && PlayerInfo[playerid][pAdmin])format(string, sizeof(string), "*%s %s: %s", RPALN(playerid), RPN(playerid), params); Log("logs/helperchat.log", string); return 1; }