29.11.2010, 06:49
Hi all,i need to make this admin chat only for reading OP's only
I've echo chan,so i send admin messages with !apm,admins ingame can read,but players in echo chan can read too,i need to make this cmd reading for only op's.
And this code is admin chat ingame,in the echo channel players can read,i need to make viewable only to ops.
Thanks alot!
I've echo chan,so i send admin messages with !apm,admins ingame can read,but players in echo chan can read too,i need to make this cmd reading for only op's.
Код:
IRCCMD:apm(botid, channel[], user[], host[], params[]) { new msg1[128]; if(EchoStatus == 0) return 1; if(MsgStatus == 0) return IRC_GroupSay(IRC_Group,channel,"4*** Error: Command disabled."); if(isnull(params)) return IRC_GroupSay(IRC_Group,channel,"3Usage: !apm <Message>"); if(IRC_IsHalfop(IRC_EchoConnection[0], EchoChan, user)) { format(msg1,sizeof(msg1),"11[Admin Chat %s(IRC)]: %s",user,params); IRC_GroupSay(IRC_Group, EchoChan, msg1); format(msg1,sizeof(msg1),"[Admin Chat %s(IRC)]: %s",user,params); SendClientMessageToAdmins(orange, msg1, 1); } return 1; }
Код:
if(text[0] == '@' && adminlevel[playerid] > 1) { new string[136]; format(string,sizeof(string),"13[Admin Chat %s(ID:%d)]: %s",GetPName(playerid),playerid,text[1]); IRC_Say(IRC_EchoConnection[0], EchoChan,string); format(string,sizeof(string),"[Admin Chat %s(ID:%d)]: %s",GetPName(playerid),playerid,text[1]); for(new i = 0; i < MAX_PLAYERS; i++) { if(adminlevel[i] >= 1 && IsPlayerConnected(i)) { SendClientMessage(i,COLOR_YELLOW,string); } } return 0; }