Make this cmd only for op's?
#1

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.

Код:
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;
}
And this code is admin chat ingame,in the echo channel players can read,i need to make viewable only to ops.

Код:
	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;
	}
Thanks alot!
Reply
#2

I don't think you can limit what messages people can see in an IRC server, it would depend on what scripts they are running and if they allow that. But it has nothing to do with SA-MP scripting at least.

You could also just modify the bot so you can PM him the commands instead of having to type them in the public channel.

I'm not really sure how your IRC plugin works, I haven't used one of these since one was released many years ago which is gone, although I do think you should try this:

pawn Код:
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_GroupSay(IRC_Group, EchoChan, string); // Notice I changed it to GroupSay, whatever that does in your plugin!
    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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)