Advertisement
BR_Gustavo

Adicionando IRC

Sep 24th, 2018
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.51 KB | None | 0 0
  1. #define BOT1NOMEPRINCIPAL           "" // Defina o Nick Do bot
  2. #define BOT1NOMEALTERNATIVO                 "" // Nome Alternativo
  3. #define BOT1NOMEREAL                "" // Real name
  4. #define BOT1NOMEDEUSUARIO           "" // O Mesmo do BOT1NOMEPRINCIPAL
  5.  
  6. #define BOT2NOMEPRINCIPAL           "" // Defina o Nick Do bot
  7. #define BOT2NOMEALTERNATIVO             "" // Nome Alternativo
  8. #define BOT2NOMEREAL                "" // Real name
  9. #define BOT2NOMEDEUSUARIO           "" // O Mesmo do BOT1NOMEPRINCIPAL
  10.  
  11. #define IRC_SERVIDOR                "" // Servidor Exemplo "irc.rizon.net"
  12. #define IRC_PORTA               () // Porta Exemplo (6667)
  13. #define IRC_CANAL               "" // Canal Exemplo #Teste
  14. #define IRC_OPERCANAL               "" // Canal Oper
  15.  
  16. new BotIDs[2],
  17.     GrupoID;
  18.  
  19. forward IRC_ConectarServidor();
  20. forward IRC_DesconectarServidor();
  21.  
  22. //==============================================================================
  23. public IRC_ConectarServidor()
  24. {
  25.     BotIDs[0] = IRC_Connect(IRC_SERVIDOR,IRC_PORTA,BOT1NOMEPRINCIPAL,BOT1NOMEREAL,BOT1NOMEDEUSUARIO,false);
  26.     IRC_SetIntData(BotIDs[0], E_IRC_CONNECT_DELAY, 02);
  27.     BotIDs[1] = IRC_Connect(IRC_SERVIDOR,IRC_PORTA,BOT2NOMEPRINCIPAL,BOT2NOMEREAL,BOT2NOMEDEUSUARIO,false);
  28.     IRC_SetIntData(BotIDs[1], E_IRC_CONNECT_DELAY,05);
  29.     GrupoID = IRC_CreateGroup();
  30.     return 1;
  31. }
  32. //==============================================================================
  33. public IRC_DesconectarServidor()
  34. {
  35.     IRC_Quit(BotIDs[0], "Server Closed");
  36.     IRC_Quit(BotIDs[1], "Server Closed");
  37.     IRC_DestroyGroup(GrupoID);
  38.     return 1;
  39. }
  40.  
  41.  
  42. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  43. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  44. // Coloque em OnGameModeInit IRC_ConectarServidor();
  45. // Coloque em OnGameModeExit IRC_DesconectarServidor();
  46. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  47. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  48. //==============================================================================
  49. IRCCMD:m(botid, channel[], user[], host[], params[])
  50. {
  51.     new Texto[100],MsgNoChat[150];
  52.     if(!IRC_IsVoice(botid, channel, user))return IRC_GroupSay(GrupoID, channel,"04ERROR: You need to be Voice to use this command!");
  53.     if(sscanf(params,"s[100]",Texto))return IRC_GroupSay(GrupoID, channel,"04USAGE: !m [text]");
  54.     format(MsgNoChat,sizeof(MsgNoChat),"31Message send:00 %s",Texto);
  55.     IRC_GroupSay(GrupoID, channel,MsgNoChat);
  56.     format(MsgNoChat,sizeof(MsgNoChat),"*** %s on IRC: %s",user,Texto);
  57.     SendClientMessageToAll(-1,MsgNoChat);
  58.     printf("[IRC Msg] %s (%s): %s",user,channel,Texto);
  59.     return 1;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement