IRC FS HELP
#1

I have added those commands for irc,

pawn Код:
IRCCMD:hcmds(botid, channel[], user[], host[], params[])
{
    if (IRC_IsHalfop(botid, channel, user))
    {
        new string[65];
        new string2[65];
        new string3[65];
        new string4[65];
        new string5[65];
        new string6[65];
        new string7[65];

        format(string, sizeof(string), "IRC COMMANDS: Admins Level 1");
        format(string2, sizeof(string2), "!h       ---- To talk as a moderator.");
        format(string3, sizeof(string3), "!hi      ---- To talk as a strange moderator.");
        format(string4, sizeof(string4), "!kick  ---- To kick a player.");
        format(string5, sizeof(string5), "!warn  ---- To warn a player.");
        format(string6, sizeof(string6), "!explode  ---- To explode a player.");
        format(string7, sizeof(string7), "!getinfo  ---- To get more information about a player.");


        IRC_Say(botid, channel, string);
        IRC_Say(botid, channel, string2);
        IRC_Say(botid, channel, string3);
        IRC_Say(botid, channel, string4);
        IRC_Say(botid, channel, string5);
        IRC_Say(botid, channel, string6);
        IRC_Say(botid, channel, string7);
    }
    if (!IRC_IsHalfop(botid, channel, user))
    {
        new string[50];
        format(string, sizeof(string), "04>> Error: 01You are not authorized to do that!");
        IRC_Say(botid, channel, string);
    }
    return 1;
}

IRCCMD:pcmds(botid, channel[], user[], host[], params[])
{
    if (IRC_IsOp(botid, channel, user))
    {
        new string[43];
        new string2[43];
        new string3[43];
        new string4[43];
        new string5[43];
        new string6[43];
        new string7[43];


        format(string, sizeof(string), "IRC COMMANDS: Admins Level 2 & 3");
        format(string2, sizeof(string2), "!p       ---- To talk as an operator.");
        format(string3, sizeof(string3), "!pi      ---- To talk as a strange operator.");
        format(string4, sizeof(string4), "!ban   ---- To ban a player.");
        format(string5, sizeof(string5), "!slap    ---- To slap a player.");
        format(string6, sizeof(string6), "!freeze   ---- To freeze a player.");
        format(string7, sizeof(string7), "!unfreeze   ---- To unfreeze a player.");

        IRC_Say(botid, channel, string);
        IRC_Say(botid, channel, string2);
        IRC_Say(botid, channel, string3);
        IRC_Say(botid, channel, string4);
        IRC_Say(botid, channel, string5);
        IRC_Say(botid, channel, string6);
        IRC_Say(botid, channel, string7);
    }
    if (!IRC_IsOp(botid, channel, user))
    {
        new string[50];
        format(string, sizeof(string), "04>> Error: 01You are not authorized to do that!");
        IRC_Say(botid, channel, string);
    }
       
    return 1;
}

IRCCMD:acmds(botid, channel[], user[], host[], params[])
{
    if (IRC_IsAdmin(botid, channel, user))
    {
        new string[50];
        new string2[50];
        new string3[50];
        new string4[50];
        new string5[50];
        new string6[50];
        new string7[50];
        new string8[50];
        new string9[50];
        new string10[50];
        new string11[50];

        format(string, sizeof(string), "IRC COMMANDS: Admins Level 4");
        format(string2, sizeof(string2), "!a     ---- To talk as an administrator.");
        format(string3, sizeof(string3), "!ai    ---- To talk as a strange administrator.");
        format(string4, sizeof(string4), "!RCON  ---- To execute a RCON command.");
        format(string5, sizeof(string5), "!fu    ---- To fuckup a player.");
        format(string6, sizeof(string6), "!disarm    ---- To disarm a player.");
        format(string7, sizeof(string7), "!resetcash    ---- To reset the cash of a player.");
        format(string8, sizeof(string8), "!giveallcash    ---- To give cash to all players.");
        format(string9, sizeof(string9), "!spawn    ---- To (re)spawn a player.");
        format(string10, sizeof(string10), "!fuck    ---- To fuck anally fuck a player.");
        format(string11, sizeof(string11), "!givecar    ---- To give a car to a player.");

        IRC_Say(botid, channel, string);
        IRC_Say(botid, channel, string2);
        IRC_Say(botid, channel, string3);
        IRC_Say(botid, channel, string4);
        IRC_Say(botid, channel, string5);
        IRC_Say(botid, channel, string6);
        IRC_Say(botid, channel, string7);
        IRC_Say(botid, channel, string8);
        IRC_Say(botid, channel, string9);
        IRC_Say(botid, channel, string10);
        IRC_Say(botid, channel, string11);
    }
    if (!IRC_IsAdmin(botid, channel, user))
    {
        new string[50];
        format(string, sizeof(string), "04>> Error: 01You are not authorized to do that!");
        IRC_Say(botid, channel, string);
    }
    return 1;
}

IRCCMD:ocmds(botid, channel[], user[], host[], params[])
{
    if (IRC_IsOwner(botid, channel, user))
    {
        new string[50];
        new string2[50];
        new string3[50];
        new string4[50];
        new string5[50];

        format(string, sizeof(string), "IRC COMMANDS: Admins Level 5");
        format(string2, sizeof(string2), "!allowweaps    ---- To allow weapons in game.");
        format(string3, sizeof(string3), "!nametagson    ---- To switchon nametags.");
        format(string4, sizeof(string4), "!nametagsoff   ---- To switchoff nametags.");
        format(string5, sizeof(string5), "!disallowweaps ---- To disallow weapons in game.");

        IRC_Say(botid, channel, string);
        IRC_Say(botid, channel, string2);
        IRC_Say(botid, channel, string3);
        IRC_Say(botid, channel, string4);
        IRC_Say(botid, channel, string5);
    }
    if (!IRC_IsOwner(botid, channel, user))
    {
        new string[50];
        format(string, sizeof(string), "04>> Error: 01You are not authorized to do that!");
        IRC_Say(botid, channel, string);
    }
    return 1;
}
it works, and theres no error in compiling.

The problem is, when I enter !pcmds or !hcmds or !acmds or !ocmds the commands display to all IRC clients, not only me.
How can I hide them from other clients and only the person who enters the commands can see them.

I also want to know, to prevent spam on the channel.
Reply
#2

Use notice instead of say.
Reply
#3

nope it didn't work, other users can see the commands,
atleast I want each level to see its own commands
Reply
#4

You used as "target" the channel instead of the user.

By the way, why don't you just use 1 string and re-format it? It'd be better.
Reply
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
You used as "target" the channel instead of the user.

By the way, why don't you just use 1 string and re-format it? It'd be better.
ik 1 string is better, but i am not in the mood to do that XD.

anyway, I tried setting the target to user, it works but it sends the strings as pm, and thats not what I want, atleast its better than as it was before but I want it to send them to the ONE WHO TYPES THE COMMAND ""ONLY"", inside the channel.
Reply
#6

I've never used the plugin so I'm not aware of it. If IRC_Say sends it as PM, then try using IRC_Notice as Vince said and don't forget to set the "target" as the user.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)