RSSy MYGO.pl Opublikowano Kwiecień 11, 2021 o 19:29 RSSy Udostępnij Opublikowano Kwiecień 11, 2021 o 19:29 Installation Place discordrelay.smx inside of ./cstrike/addons/sourcemod/plugins Dependencies SteamWorks - https://forums.alliedmods.net/showthread.php?t=229556 SMJansson - https://forums.alliedmods.net/showthread.php?t=184604 Discord-api - https://forums.alliedmods.net/showthread.php?t=292448 Ripext (sourcemod REST api) - https://forums.alliedmods.net/showthread.php?t=298024 Examples Discord -> Server https://prnt.sc/119uzjm Server -> Discord https://prnt.sc/119uqvu Features - Client steam avatars for discord webhook pfp - Map Change and Client Connect/Disconnect messages - Client messages sent to discord (commands can be ignored using cvars) Configuration All of this is on the github and looks a bit neater. Spoiler discrelay_steamapikey This will be your steam API key which you can find at https://steamcommunity.com/dev/apikey. The key is used to grab the client ISteamUser/GetPlayerSummariesfrom the steam api so it can change the discord webhook's avatar to the clients steam avatar. If you aren't going to be using webhook avatars (discrelay_servertodiscordavatars) then you can leave this blank, just make sure that discrelay_servertodiscordavatars is 0. discrelay_discordbottoken This will be your discord bots token which is found/created by going to https://discord.com/developers/applications, creating an application, then in the bots setting by creating a bot and copying the bot token. You do not need the bot to be running, just having it in your server will work. The discord bot is responsible for handling discord to server interaction, in order to use this feature discrelay_discordserverid, discrelay_channelid, and discrelay_discordtoserver need to be set correctly. discrelay_discordwebhook Set this to your webhook url, you can create one by going to your discord server, entering a text channels settings, integrations, create a webhook, then copy url. The webhook is needed to handle all server to discord integration, if you don't want to have anything going to your discord server from the server leave this blank and be sure to set discrelay_servertodiscord, and all message cvars (ex: discrelay_connectmessage) to 0. discrelay_discordserverid This is for discord to server integration, to get it make sure developer mode is enabled in your discord and right clicking on the server and clicking Copy Id. discrelay_discordbottoken, discrelay_channelid, and discrelay_discordtoserver need to be set for messages to go through. discrelay_channelid This is for discord to server integration, to get it make sure developer mode is enabled in your discord and right clicking on the channel and clicking Copy Id. This will be the channel that messages sent in will go to the server. discrelay_discordbottoken, discrelay_discordserverid, and discrelay_discordtoserver need to be set for messages to go through. discrelay_servertodiscord Enable to allow messages sent in the server to be sent through discord through the webhook. Requires that discrelay_discordwebhook is set to a valid URL. discrelay_discordtoserver Enable to allow messages sent in discord to be sent to the server. Requires discrelay_discordbottoken, discrelay_discordserverid, and discrelay_channelid to be set. discrelay_servertodiscordavatars Enable to make webhooks change its avatar to the client's steam avatar. Requires that discrelay_steamapikey and discrelay_discordwebhook are valid. discrelay_connectmessage Enable to allow client connection messages to be sent to discord through the webhook. discrelay_disconnectmessage Enable to allow client disconnection messages to be sent to discord through the webhook. discrelay_mapchangemessage Enable to allow map changes to be sent to discord through the webhook. discrelay_message Enable to allow client messages in the server to be sent to discord though the webhook. This is any message thats not a command, only exception is any ! command which can be hidden by enabling discrelay_hideexclammessage. discrelay_hideexclammessage Hides any message that begins with !, discrelay_message needs to be enabled for this to work. discrelay_msg_textcol & discrelay_msg_varcol HTML Code: CPrintToChatAll("%s[%sDiscord%s] %s%s%s#%s%s%s: %s", g_msg_textcol, g_msg_varcol, g_msg_textcol, g_msg_varcol, discorduser, g_msg_textcol, g_msg_varcol, discriminator, g_msg_textcol, message); discorduser, discriminator, and message are discord things, but g_msg_textcol and g_msg_varcol refer to the colors used for the message that will be sent to the server when doing discord -> server. The plugin uses morecolors.inc to supply the colors, so when setting the cvar make sure to set it like {red} for example. For a list of colors you can refer to https://forums.alliedmods.net/showthread.php?t=185016 Github link https://github.com/IsThatLogic/sp-discordrelay Attached Files Get Plugin or Get Source (discordrelay.sp - 11.0 KB) discordrelay.smx (16.6 KB) Wyświetl pełny artykuł Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi