Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <irc>
- #pragma tabsize 0
- // Name that everyone will see
- #define BOT_1_NICKNAME "BotA"
- // Name that will only be visible in a whois
- #define BOT_1_REALNAME "SA-MP Bot"
- // Name that will be in front of the hostname (username@hostname)
- #define BOT_1_USERNAME "bot"
- #define IRC_SERVER "irc.focogaming.com"
- #define IRC_PORT (6667)
- #define IRC_CHANNEL "#irc-bots"
- #define IRC_PASSWORD "nickserv_password"
- #define IsOwner !strcmp(host, "YOURIDENT@YOURHOST")
- new gBotID;
- public OnFilterScriptInit()
- {
- gBotID = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_1_NICKNAME, BOT_1_REALNAME, BOT_1_USERNAME);
- }
- public OnFilterScriptExit()
- {
- // Disconnect the bot
- IRC_Quit(gBotID, "Filterscript exiting");
- }
- public IRC_OnConnect(botid)
- {
- new string[128];
- format(string, sizeof(string), "PRIVMSG NickServ identify %s", IRC_PASSWORD);
- IRC_JoinChannel(botid, IRC_CHANNEL);
- IRC_SendRaw(gBotID, string);
- return 1;
- }
- //COMMANDS
- IRCCMD:say(botid, channel[], user[], host[], params[])
- {
- // Check if the user is a bot owner
- if (IsOwner)
- {
- IRC_Say(gBotID, channel, params);
- }
- return 1;
- }
- IRCCMD:rcon(botid, channel[], user[], host[], params[])
- {
- // Check if the user is a bot owner
- if (IsOwner)
- {
- new msg[128];
- format(msg, sizeof(msg), "RCON command %s has been executed.", params);
- IRC_Say(gBotID, channel, msg);
- SendRconCommand(params);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement