SA-MP Forums Archive
2 IRC commands. - 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: 2 IRC commands. (/showthread.php?tid=397367)



2 IRC commands. - Astralis - 04.12.2012

pawn Код:
irccmd_pm(conn, channel[], user[], params[])
{
        new giveid,msg[256],lolz1[256], lolz2[256], pon[100];
        if(sscanf(params,"ss",pon,msg)) return IRC_Say(EchoConnection, EchoChan,"3Usage: !pm <PartOfName/PlayerID> <Message>");
    giveid = ReturnUser(pon);
        if(!IsPlayerConnected(giveid))return IRC_Say(EchoConnection, EchoChan,"4*** Error: Invalid player ID.");
        format(lolz1,256, "*** Pm from %s (IRC): %s",user, msg);
        format(lolz2,256, "5*** Pm to %s (ID:%d): %s",PlayerName(giveid),giveid,msg);
        SendClientMessage(giveid,green,lolz1);
        IRC_Say(EchoConnection, EchoChan, lolz2);
        #pragma unused conn, channel
        return true;
}
irccmd_say(conn, channel[], user[], params[])
{
        if(!strlen(params)) return IRC_Say(EchoConnection,channel,"3Usage: !say <Message>");
        new lolz1[256], lolz2[256];
        if(IsPlayerOwner(conn,channel,user))
        {
                format(lolz1,256,"* Admin %s on irc: %s",user,params);
                SendClientMessageToAll(orange, lolz1);
                format(lolz2,256,"2* Admin %s on irc: %s",user,params);
                IRC_Say(EchoConnection,channel,lolz2);
                return true;
        }
        else if(IsPlayerSop(conn,channel,user))
        {
                format(lolz1,256,"* Admin %s on irc: %s",user,params);
                SendClientMessageToAll(orange, lolz1);
                format(lolz2,256,"2* Admin %s on irc: %s",user,params);
                IRC_Say(EchoConnection,channel,lolz2);
                return true;
        }
        else if(IsPlayerOp(conn,channel,user))
        {
                format(lolz1,256,"* Admin %s on irc: %s",user,params);
                SendClientMessageToAll(orange, lolz1);
                format(lolz2,256,"2* Admin %s on irc: %s",user,params);
                IRC_Say(EchoConnection,channel,lolz2);
                return true;
        }
        else if(IsPlayerHop(conn,channel,user))
        {
                format(lolz1,256,"* Mod %s on irc: %s",user,params);
                SendClientMessageToAll(orange, lolz1);
                format(lolz2,256,"2* Mod %s on irc: %s",user,params);
                IRC_Say(EchoConnection,channel,lolz2);
                return true;
        }
        else if(IsPlayerVoi(conn,channel,user))
        {
                format(lolz1,256,"* Guest %s on irc: %s",user,params);
                SendClientMessageToAll(orange, lolz1);
                format(lolz2,256,"2* Guest %s on irc: %s",user,params);
                IRC_Say(EchoConnection,channel,lolz2);
                return true;
        }
        format(lolz1,256,"* Guest %s on irc: %s",user,params);
        SendClientMessageToAll(orange, lolz1);
        format(lolz2,256,"2* Guest %s on irc: %s",user,params);
        IRC_Say(EchoConnection,channel,lolz2);
    #pragma unused conn
        return true;
}
Could someone make that you must have "Op" in the channel to use !say and !pm?


Re: 2 IRC commands. - tyler12 - 04.12.2012

The "%" sign sends messages to all halfops and above.
IRC_Say(EchoConnection, "%"#EchoChan, lolz2);


Re: 2 IRC commands. - McBan - 04.12.2012

irccmd_pm(conn, channel[], user[], params[])
{
new giveid,msg[256],lolz1[256], lolz2[256], pon[100];
if(sscanf(params,"ss",pon,msg)) return IRC_Say(EchoConnection, EchoChan,"3Usage: !pm <PartOfName/PlayerID> <Message>");
giveid = ReturnUser(pon);
if(!IsPlayerConnected(giveid))return IRC_Say(EchoConnection, EchoChan,"4*** Error: Invalid player ID.");
format(lolz11,256, "*** Pm from %s (IRC): %s",user, msg);
format(lolz21,256, "5*** Pm to %s (ID:%d): %s",PlayerName(giveid),giveid,msg);
SendClientMessage(giveid,green,lolz1);
IRC_Say(EchoConnection, EchoChan, lolz2);
#pragma unused conn, channel
return true;
}
irccmd_say(conn, channel[], user[], params[])
{
if(!strlen(params)) return IRC_Say(EchoConnection,channel,"3Usage: !say <Message>");
new lolz1[256], lolz2[256];
if(IsPlayerOwner(conn,channel,user))
{
format(lolz1,256,"* Admin %s on irc: %s",user,params);
SendClientMessageToAll(orange, lolz1);
format(lolz2,256,"2* Admin %s on irc: %s",user,params);
IRC_Say(EchoConnection,channel,lolz2);
return true;
}
else if(IsPlayerSop(conn,channel,user))
{
format(lolz1,256,"* Admin %s on irc: %s",user,params);
SendClientMessageToAll(orange, lolz1);
format(lolz2,256,"2* Admin %s on irc: %s",user,params);
IRC_Say(EchoConnection,channel,lolz2);
return true;
}
else if(IsPlayerOp(conn,channel,user))
{
format(lolz1,256,"* Admin %s on irc: %s",user,params);
SendClientMessageToAll(orange, lolz1);
format(lolz2,256,"2* Admin %s on irc: %s",user,params);
IRC_Say(EchoConnection,channel,lolz2);
return true;
}
else if(IsPlayerHop(conn,channel,user))
{
format(lolz1,256,"* Mod %s on irc: %s",user,params);
SendClientMessageToAll(orange, lolz1);
format(lolz2,256,"2* Mod %s on irc: %s",user,params);
IRC_Say(EchoConnection,channel,lolz2);
return true;
}
else if(IsPlayerVoi(conn,channel,user))
{
format(lolz1,256,"* Guest %s on irc: %s",user,params);
SendClientMessageToAll(orange, lolz1);
format(lolz2,256,"2* Guest %s on irc: %s",user,params);
IRC_Say(EchoConnection,channel,lolz2);
return true;
}
format(lolz1,256,"* Guest %s on irc: %s",user,params);
SendClientMessageToAll(orange, lolz1);
format(lolz2,256,"2* Guest &s on irc: %s",user,params);
IRC_Say(EchoConnection,channel,lolz2);
#pragma unused conn
return true;
}

try that it should work. Report back please


Re: 2 IRC commands. - Astralis - 04.12.2012

http://pastebin.com/f1b635959

Could you add !say and !pm commands to be used only if Player has OP in the channel?


Re: 2 IRC commands. - Djole1337 - 04.12.2012

Rofl, you're still using dcmd ? Use Incognito's plugin instead.