Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.54 KB | None | 0 0
  1. #include <a_samp>
  2. #include <irc>
  3. #pragma tabsize 0
  4.  
  5. // Name that everyone will see
  6. #define BOT_1_NICKNAME "BotA"
  7. // Name that will only be visible in a whois
  8. #define BOT_1_REALNAME "SA-MP Bot"
  9. // Name that will be in front of the hostname (username@hostname)
  10. #define BOT_1_USERNAME "bot"
  11.  
  12. #define BOT_2_NICKNAME "BotB"
  13. #define BOT_2_REALNAME "SA-MP Bot"
  14. #define BOT_2_USERNAME "bot"
  15.  
  16. #define IRC_SERVER "irc.focogaming.com"
  17. #define IRC_PORT (6667)
  18. #define IRC_CHANNEL "#irc-bots"
  19. #define IRC_PASSWORD "nickserv_password"
  20.  
  21. #define IsOwner !strcmp(host, "YOURIDENT@YOURHOST")
  22.  
  23. new gBotID;
  24.  
  25.  
  26. public OnFilterScriptInit()
  27. {
  28.     gBotID = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_1_NICKNAME, BOT_1_REALNAME, BOT_1_USERNAME);
  29. }
  30.  
  31.  
  32. public OnFilterScriptExit()
  33. {
  34.     // Disconnect the bot
  35.     IRC_Quit(gBotID, "Filterscript exiting");
  36. }
  37. public IRC_OnConnect(botid)
  38. {
  39.         new string[128];
  40.         format(string, sizeof(string), "PRIVMSG NickServ identify %s", IRC_PASSWORD);
  41.     IRC_JoinChannel(botid, IRC_CHANNEL);
  42.     IRC_SendRaw(gBotID, string);
  43.     return 1;
  44. }
  45. //COMMANDS
  46. IRCCMD:say(botid, channel[], user[], host[], params[])
  47. {
  48.     // Check if the user is a bot owner
  49.     if (IsOwner)
  50.     {
  51.         IRC_Say(gBotID, channel, params);
  52.     }
  53.     return 1;
  54. }
  55.  
  56.  
  57. IRCCMD:rcon(botid, channel[], user[], host[], params[])
  58. {
  59.     // Check if the user is a bot owner
  60.     if (IsOwner)
  61.     {
  62.                 new msg[128];
  63.         format(msg, sizeof(msg), "RCON command %s has been executed.", params);
  64.         IRC_Say(gBotID, channel, msg);
  65.         SendRconCommand(params);
  66.     }
  67.     return 1;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement