Guest User

Untitled

a guest
Aug 8th, 2020
60
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <a_samp>
  2. #include <discord-connector>
  3.  
  4.  
  5. // Tec9s Discord Include made by Tec9. © 2020
  6.  
  7. // Defines
  8.  
  9. #define GUILD_ID "" // Your Server ID!
  10.  
  11. //
  12.  
  13.  
  14. stock BanUserDiscord(victim[],reason[])
  15. {
  16. new length = strlen(victim),hashtagNumbr[12];
  17. strmid(hashtagNumbr,victim,length-4,length,255);
  18. new userName[24];
  19. strmid(userName,victim,0,length-5,255);
  20. new DCC_User:dicc = DCC_FindUserByName(userName,hashtagNumbr);
  21. new DCC_Guild:jGuild = DCC_FindGuildById(GUILD_ID);
  22. if(DCC_User:dicc == DCC_User:0) {printf("[TEC9's DISCORD INCLUDE] User %s could not be banned, reason: Invalid Discord-Name!",victim); return 0;}
  23. if(DCC_Guild:jGuild == DCC_Guild:0) {printf("[TEC9's DISCORD INCLUDE] User %s could not be banned, reason: Invalid Guild ID!",victim); return 0;}
  24. DCC_CreateGuildMemberBan(jGuild,DCC_User:dicc,reason);
  25. return 1;
  26. }
  27. stock RemoveBanUserDiscord(victim[])
  28. {
  29. new length = strlen(victim),hashtagNumbr[12];
  30. strmid(hashtagNumbr,victim,length-4,length,255);
  31. new userName[24];
  32. strmid(userName,victim,0,length-5,255);
  33. new DCC_User:dicc = DCC_FindUserByName(userName,hashtagNumbr);
  34. new DCC_Guild:jGuild = DCC_FindGuildById(GUILD_ID);
  35. if(DCC_User:dicc == DCC_User:0) {printf("[TEC9's DISCORD INCLUDE] User %s's Ban couldn't be removed, reason: Invalid Discord-Name!",victim); return 0;}
  36. if(DCC_Guild:jGuild == DCC_Guild:0) {printf("[TEC9's DISCORD INCLUDE] User %s's Ban couldn't be removed, reason: Invalid Guild ID!",victim); return 0;}
  37. DCC_RemoveGuildMemberBan(jGuild,DCC_User:dicc);
  38. return 1;
  39. }
  40. stock KickUserDiscord(victim[],reason[])
  41. {
  42. new length = strlen(victim),hashtagNumbr[12];
  43. strmid(hashtagNumbr,victim,length-4,length,255);
  44. new userName[24];
  45. strmid(userName,victim,0,length-5,255);
  46. new DCC_User:dicc = DCC_FindUserByName(userName,hashtagNumbr);
  47. new DCC_Guild:jGuild = DCC_FindGuildById(GUILD_ID);
  48. if(DCC_User:dicc == DCC_User:0) { printf("[TEC9's DISCORD INCLUDE] User %s could not be kicked, reason: Invalid Discord-Name!",victim); return 0;}
  49. if(DCC_Guild:jGuild == DCC_Guild:0) {printf("[TEC9's DISCORD INCLUDE] User %s could not be kicked, reason: Invalid Guild ID!",victim); return 0;}
  50. DCC_RemoveGuildMember(jGuild,DCC_User:dicc);
  51. return 1;
  52. }
  53.  
  54.  
  55. stock AddUserRole(victim[],role[])
  56. {
  57. new length = strlen(victim),hashtagNumbr[12];
  58. strmid(hashtagNumbr,victim,length-4,length,255);
  59. new userName[24];
  60. strmid(userName,victim,0,length-5,255);
  61. new DCC_User:dicc = DCC_FindUserByName(userName,hashtagNumbr);
  62. new DCC_Guild:jGuild = DCC_FindGuildById(GUILD_ID),DCC_Role:roleID = DCC_FindRoleByName(jGuild,role);
  63. if(DCC_User:dicc == DCC_User:0) { printf("[TEC9's DISCORD INCLUDE] User %s's Role couldn't be added, reason: Invalid Discord-Name!",victim); return 0;}
  64. if(DCC_Guild:jGuild == DCC_Guild:0) { printf("[TEC9's DISCORD INCLUDE] User %s's Role couldn't be added, reason: Invalid Guild ID!",victim); return 0;}
  65. if(DCC_Role:roleID == DCC_Role:0) { printf("[TEC9's DISCORD INCLUDE] User %s's couldn't be added, reason: Invalid Role ID!",victim); return 0;}
  66. DCC_AddGuildMemberRole(jGuild,DCC_User:dicc,DCC_Role:roleID);
  67. return 1;
  68. }
  69.  
  70. stock RemoveUserRole(victim[],role[])
  71. {
  72. new length = strlen(victim),hashtagNumbr[12];
  73. strmid(hashtagNumbr,victim,length-4,length,255);
  74. new userName[33];
  75. strmid(userName,victim,0,length-5,255);
  76. new DCC_User:dicc = DCC_FindUserByName(userName,hashtagNumbr);
  77. new DCC_Guild:jGuild = DCC_FindGuildById(GUILD_ID),DCC_Role:roleID = DCC_FindRoleByName(jGuild,role);
  78. if(DCC_User:dicc == DCC_User:0) { printf("[TEC9's DISCORD INCLUDE] User %s's Role couldn't be removed, reason: Invalid Discord-Name!",victim); return 0;}
  79. if(DCC_Guild:jGuild == DCC_Guild:0) { printf("[TEC9's DISCORD INCLUDE] User %s's Role couldn't be removed, reason: Invalid Guild ID!",victim); return 0;}
  80. if(DCC_Role:roleID == DCC_Role:0) { printf("[TEC9's DISCORD INCLUDE] User %s's Role couldn't be removed, reason: Invalid Role ID!",victim); return 0;}
  81. DCC_RemoveGuildMemberRole(jGuild,DCC_User:dicc,DCC_Role:roleID);
  82. return 1;
  83. }
  84.  
  85.  
  86. stock UserGotRole(victim[],role[])
  87. {
  88. new length = strlen(victim),hashtagNumbr[12],bool:playerGotRole;
  89. strmid(hashtagNumbr,victim,length-4,length,255);
  90. new userName[33];
  91. strmid(userName,victim,0,length-5,255);
  92. new DCC_User:dicc = DCC_FindUserByName(userName,hashtagNumbr);
  93. new DCC_Guild:jGuild = DCC_FindGuildById(GUILD_ID),DCC_Role:roleID = DCC_FindRoleByName(jGuild,role);
  94. if(DCC_User:dicc == DCC_User:0) { printf("[TEC9's DISCORD INCLUDE] User %s's Role couldn't be checked, reason: Invalid Discord-Name!",victim); return 0;}
  95. if(DCC_Guild:jGuild == DCC_Guild:0) { printf("[TEC9's DISCORD INCLUDE] User %s's Role couldn't be checked, reason: Invalid Guild ID!",victim); return 0;}
  96. if(DCC_Role:roleID == DCC_Role:0) { printf("[TEC9's DISCORD INCLUDE] User %s's Role couldn't be checked, reason: Invalid Role ID!",victim); return 0;}
  97. DCC_HasGuildMemberRole(jGuild,DCC_User:dicc,DCC_Role:roleID,playerGotRole);
  98. return playerGotRole;
  99. }
  100.  
  101. stock SendMessageToChannel(ChannelId[],const string[])
  102. {
  103. new DCC_Channel:TargetChannel;
  104. TargetChannel = DCC_FindChannelByName(ChannelId);
  105. DCC_SendChannelMessage(TargetChannel, string);
  106. return 1;
  107. }
RAW Paste Data