SHARE
TWEET

Untitled

a guest Feb 18th, 2019 254 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <a_samp>
  2.  
  3. #include <discord-connector>
  4.  
  5. new DCC_Channel:g_Discord_Chat;
  6.  
  7. public OnFilterScriptInit()
  8. {
  9.     print("\n===================================");
  10.     print("|  DISCORD IRC SYSTEM V.1.0 |");
  11.     print("|  By PAUL_WALKER SYSTEM LOADED SUCCESFULL |");
  12.     print("=====================================\n");
  13.     g_Discord_Chat = DCC_FindChannelById("CHANNEL CLIENT ID"); // Discord channel ID
  14.     return 1;
  15. }
  16.  
  17. public DCC_OnChannelMessage(DCC_Channel:channel, DCC_User:author, const message[])
  18. {
  19.     new bool:IsBot;
  20.     DCC_IsUserBot(author, IsBot);
  21.     if(channel == g_Discord_Chat && IsBot == false)///Blocking Your Channel Bots Messages InGame
  22.     {
  23.         new user_name[32 + 1], str[128];
  24.         DCC_GetUserName(author, user_name);
  25.         format(str,sizeof(str), "{8a6cd1}[DISCORD] {aa1bb5}%s: {0fbf61}%s",user_name, message);
  26.         SendClientMessageToAll(-1, str);
  27.     }
  28.  
  29.     return 1;
  30. }
  31.  
  32. public OnPlayerText(playerid, text[])
  33. {
  34.  
  35.     new name[MAX_PLAYER_NAME + 1];
  36.     GetPlayerName(playerid, name, sizeof name);
  37.     new msg[128]; // The string. We do not need to have it larger than 128, because a message can't be larger than that.
  38.     format(msg, sizeof(msg), "```[%s] %s```", name, text);
  39.     DCC_SendChannelMessage(g_Discord_Chat, msg);
  40.     return 1;
  41. }
  42.  
  43.  
  44.  
  45. public OnPlayerConnect(playerid)
  46. {
  47.     new name[MAX_PLAYER_NAME + 1];
  48.     GetPlayerName(playerid, name, sizeof name);
  49.  
  50.     if (_:g_Discord_Chat == 0)
  51.     g_Discord_Chat = DCC_FindChannelById("CHANNEL CLIENT ID"); // Discord channel ID
  52.  
  53.     new string[128];
  54.     format(string, sizeof string, " ```%s Joined The Server.:)```", name);
  55.     DCC_SendChannelMessage(g_Discord_Chat, string);
  56.     return 1;
  57. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top