SA-MP Forums Archive
Using Admin Commands On IRC - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Using Admin Commands On IRC (/showthread.php?tid=353955)



Using Admin Commands On IRC - shayan122 - 25.06.2012

Hello

i'm using Lux Admin on my Server and im also using irc filterscript/plugin
there are some Commands like (!kick !ban !say)

how can i add some more command For Diffrent levels (+OP , +HOP , +V .... )
(Like: !players (To see Users IG - !warn .. ))
or how can i use Lux admin Commands on IRC!



Re: Using Admin Commands On IRC - Ironboy - 25.06.2012

I don't think this will help you, anyway here is the commands

pawn Код:
IRCCMD:kick(botid, channel[], user[], host[], params[]) {
    // Check if the user is at least a halfop in the channel
    if (IRC_IsHalfop(botid, channel, user)) {
        new playerid, reason[64];
        // If the user did enter a player ID, then the command will not be processed
        if (sscanf(params, "dz", playerid, reason)) {
            return 1;}
        // If the player is not connected, then nothing will be done
        if (IsPlayerConnected(playerid)) {
            new msg[128], playname[MAX_PLAYER_NAME];
            // If no reason is given, then "No reason" will be stated
            if (isnull(reason)) {
                format(reason, sizeof(reason), "No reason");}
            // Echo the formatted message and kick the user
            GetPlayerName(playerid, playname, sizeof(playname));
            format(msg, sizeof(msg), "04*** %s has been kicked by %s on IRC. (%s)", playname, user, reason);
            Say(channel,msg);
            format(msg, sizeof(msg), "*** %s has been kicked by %s on IRC. (%s)", playname, user, reason);
            SendMessageToAll(COLOR_RED, msg);
            Kick(playerid);}}
    return 1;}

IRCCMD:ban(botid, channel[], user[], host[], params[])
{
    // Check if the user is at least an op in the channel
    if (IRC_IsOp(botid, channel, user))
    {
        new playerid, reason[64];
        // If the user did enter a player ID, then the command will not be processed
        if (sscanf(params, "dz", playerid, reason))
        {
            return 1;
        }
        // If the player is not connected, then nothing will be done
        if (IsPlayerConnected(playerid))
        {
            new msg[128], playname[MAX_PLAYER_NAME];
            // If no reason is given, then "No reason" will be stated
            if (isnull(reason))
            {
                format(reason, sizeof(reason), "No reason");
            }
            // Echo the formatted message and ban the user
            GetPlayerName(playerid, playname, sizeof(playname));
            format(msg, sizeof(msg), "04*** %s has been banned by %s on IRC. (%s)", playname, user, reason);
            Say(channel,msg);
            format(msg, sizeof(msg), "*** %s has been banned by %s on IRC. (%s)", playname, user, reason);
            SendMessageToAll(COLOR_RED, msg);
            BanEx(playerid, reason);
        }
    }
    return 1;
}

IRCCMD:say(botid, channel[], user[], host[], params[]) {
    new msg1[256], msg2[256],string[128];
    if(IRC_IsOp(botid, channel, user)) {
        format(msg1, sizeof(msg1), "2* Admin %s (IRC): %s", user, params);
        Say(channel,string);
        format(msg2, sizeof(msg2), "* Admin %s (IRC): %s", user, params);
        SendClientMessageToAll(orange, msg2);}
    else if(IRC_IsHalfop(botid, channel, user)) {
        format(msg1, sizeof(msg1), "2* Mod %s (IRC): %s", user, params);
        Say(channel,string);
        format(msg2, sizeof(msg2), "* Mod %s (IRC): %s", user, params);
        SendClientMessageToAll(orange, msg2);}
    else if(IRC_IsVoice(botid, channel, user)) {
        format(msg1, sizeof(msg1), "2* Guest %s (IRC): %s", user, params);
        Say(channel,string);
        format(msg2, sizeof(msg2), "* Guest %s (IRC): %s", user, params);
        SendClientMessageToAll(orange, msg2);}
    return 1;}



Re: Using Admin Commands On IRC - Niko_boy - 25.06.2012

codded in hurry
here you go !players

pawn Код:
ICMD:players( botid, channel[], user[], host[], params[] )
{
    new tempstr[128], string[200], count, name[24];
    for( new i ,slots = GetMaxPlayers(); i < slots; i++ )
    {
        if( IsPlayerConnected(i) )
        {
            count++;
            GetPlayerName( i, name, sizeof(name) );
            format( tempstr, sizeof(tempstr), "%s , %s", tempstr, name );
        }
    }
    if( count )
    {
        format( string, sizeof(string), "Connected Players[%d/%d]:- %s", count, GetMaxPlayers(), tempstr);
               IRC_Say( botid, channel, string );
    }else IRC_Say( botid, channel, "No Player Online" );
    return 1;
}



Re: Using Admin Commands On IRC - shayan122 - 25.06.2012

Thank You Both But Ironboy Kick,ban,Say Are in IRC filterscript!

NicoBoy , I was looking for That, Thanks

How can i Set My Bot That Give anyOne who Join Channel Voice (+V)?

And How To Add !CMDS ?
Like:
Код:
Cmds For Half OP :
!players !kick ...



Re: Using Admin Commands On IRC - Djole1337 - 25.06.2012

Quote:
Originally Posted by shayan122
Посмотреть сообщение
Thank You Both But Ironboy Kick,ban,Say Are in IRC filterscript!

NicoBoy , I was looking for That, Thanks

How can i Set My Bot That Give anyOne who Join Channel Voice (+V)?

And How To Add !CMDS ?
Like:
Код:
Cmds For Half OP :
!players !kick ...
pawn Код:
IRCCMD:cmds(botid, channel[], user[], host[], params[])
{
    if(!IRC_IsHalfOp(botid, channel, user))
    {
        IRC_ReplyCTCP(botid, user, "!players");
    }
    else
    {
            IRC_ReplyCTCP(botid, user, "!kick [id] [reason]");

        }
    return true;
}



Re: Using Admin Commands On IRC - shayan122 - 25.06.2012

Thanks MR_Djole