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;
}
&& mean that you need to be helper and admin to use this command you can use || this mean you need to be helper or admin
|
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; }