SA-MP Forums Archive
Need help making the sa-mp server send a message when someone join/leave the IRC channel. - 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: Need help making the sa-mp server send a message when someone join/leave the IRC channel. (/showthread.php?tid=340372)



Need help making the sa-mp server send a message when someone join/leave the IRC channel. - OleKristian95 - 07.05.2012

This is some of the (dont know what its called) things the irc.inc have.

IRC_Connect()
IRC_Quit()
IRC_JoinChannel()
IRC_PartChannel()
IRC_ChangeNick()
IRC_KickUser()

I would like a message for every time someone join, leave, change name, or gets kicked.


Re: Need help making the sa-mp server send a message when someone join/leave the IRC channel. - Yuryfury - 07.05.2012

All of these are basically part of the irc.pwn filterscript (that came with the include)

pawn Code:
public IRC_OnUserDisconnect(botid, user[], host[], message[])
{
    printf("*** IRC_OnUserDisconnect (Bot ID %d): User %s (%s) disconnected (%s)", botid, user, host, message);
    return 1;
}

public IRC_OnUserJoinChannel(botid, channel[], user[], host[])
{
    printf("*** IRC_OnUserJoinChannel (Bot ID %d): User %s (%s) joined channel %s", botid, user, host, channel);
    return 1;
}

public IRC_OnUserLeaveChannel(botid, channel[], user[], host[], message[])
{
    printf("*** IRC_OnUserLeaveChannel (Bot ID %d): User %s (%s) left channel %s (%s)", botid, user, host, channel, message);
    return 1;
}

public IRC_OnUserKickedFromChannel(botid, channel[], kickeduser[], oppeduser[], oppedhost[], message[])
{
    printf("*** IRC_OnUserKickedFromChannel (Bot ID %d): User %s kicked by %s (%s) from channel %s (%s)", botid, kickeduser, oppeduser, oppedhost, channel, message);
}

public IRC_OnUserNickChange(botid, oldnick[], newnick[], host[])
{
    printf("*** IRC_OnUserNickChange (Bot ID %d): User %s (%s) changed his/her nick to %s", botid, oldnick, host, newnick);
    return 1;
}
Simply save the printf message to a string and do SendClientMessageToAll.


Re: Need help making the sa-mp server send a message when someone join/leave the IRC channel. - OleKristian95 - 07.05.2012

Oh thanks alot