AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   AMXX Chat Relay [Discord <=> Ingame] (https://forums.alliedmods.net/showthread.php?t=318610)

endnch 09-09-2019 17:21

AMXX Chat Relay [Discord <=> Ingame]
 
3 Attachment(s)
AMXX client for the Discord bot in this plugin:
https://forums.alliedmods.net/showthread.php?t=311079

Introduction

Communicate between Discord & In-Game, monitor server without being in-game, control the flow of messages and user base engagement!

Features

- Recieve and send messages bidrectionally
- Channel configuration for powerful setups
- Setup is incrediblily easy with Discord bot commands and simple config files
- Upon disconnect, game servers will attempt to reconnect at a fixed interval

Prerequisites

- AMX Mod X 1.10 (tested on build 5378)
- Server to host the relay binary on (with MySQL if not external)
- A Discord bot token (https://discordapp.com/developers/applications/)
- Discord Bot v2.0.0 (https://github.com/rumblefrog/source...relay/releases)

Bot Installation

https://rumblefrog.me/source-chat-relay/setup

Plugin Installation

- Copy the plugin to your plugins folder
- Add the plugin filename to your configs/plugins.ini file
- Copy the config file to you configs/plugins folder
- Edit the config file
- Change map to load the plugin
- You should get a "[AMXX-Server-Relay] Successfully authenticated" message if you did everything correctly

JocAnis 09-09-2019 21:28

Re: AMX Chat Relay [Discord <=> Ingame]
 
Finally something really new and interesting in "New Plugin Submissions"

I successfully did a connection so amxx will trigger a discord bot to write something in the specific channel, but could do opposite, to read command and react on them...how it seems your work is doing right that

Can you exaplain in detail what does this mean?

Server to host the relay binary on (with MySQL if not external)
(mysql is must-need?)

Also why amxmodx 1.10 ... :D

endnch 09-09-2019 21:48

Re: AMX Chat Relay [Discord <=> Ingame]
 
Quote:

Originally Posted by JocAnis (Post 2666465)
Finally something really new and interesting in "New Plugin Submissions"

Can you exaplain in detail what does this mean?

Server to host the relay binary on (with MySQL if not external)
(mysql is must-need?)

Also why amxmodx 1.10 ... :D

You need to run the Bot software so the game server can communicate with your Discord server. You can run the software on your computer, or you can run it on a server so it stays online 24/7. The software requires a MySQL database to store information about the clients that connect to it and the channels in your discord server. You can run this database in the same computer/server as the software or you can run it externally in another server.

I put 1.10 because that's the version I tested it on, in the code I use some functions that were introduced in 1.9 so technically it should work in 1.9 too, but I haven't tested it.

DON KHAN 1 09-10-2019 06:07

Re: AMX Chat Relay [Discord <=> Ingame]
 
Very Nice plugin.
One thing there is 1.8.2 is latest version of amxmodx i have seen in amxmodx.org so u should make this plugin work on 1.8.2.
BTW its very nice plugin.

Mistrick 09-10-2019 06:28

Re: AMX Chat Relay [Discord <=> Ingame]
 
Don't use blocking socket for every chat message.
Do you know about curl or grip?

OciXCrom 09-10-2019 07:25

Re: AMX Chat Relay [Discord <=> Ingame]
 
Quote:

Originally Posted by DON KHAN 1 (Post 2666489)
Very Nice plugin.
One thing there is 1.8.2 is latest version of amxmodx i have seen in amxmodx.org so u should make this plugin work on 1.8.2.
BTW its very nice plugin.

It's 2019, start using new stuff. 1.8.2 will soon be an unsupported version, so there's no point in doing that - simply not worth it. Discord didn't even exist when that version came out.
------------------------------------------------------
Word of advice - maybe a better name for the plugin will be "AMXX Chat Relay". AMX is a very old and no longer supported version of AMXX.

PS: you don't need to include "amxconst" and "cvars" manually - they are already included in "amxmodx".

HamletEagle 09-10-2019 07:32

Re: AMX Chat Relay [Discord <=> Ingame]
 
Quote:

Originally Posted by OciXCrom (Post 2666502)
It's 2019, start using new stuff. 1.8.2 will soon be an unsupported version, so there's no point in doing that - simply not worth it. Discord didn't even exist when that version came out.
------------------------------------------------------
Word of advice - maybe a better name for the plugin will be "AMXX Chat Relay". AMX is a very old and no longer supported version of AMXX.

PS: you don't need to include "amxconst" and "cvars" manually - they are already included in "amxmodx".

"Soon"

LearninG 09-10-2019 08:21

Re: AMX Chat Relay [Discord <=> Ingame]
 
was looking randomly to code , and saw these :
Code:
new sKillerName[MAX_NAME_LENGTH]; get_user_name(killer, sKillerName, MAX_NAME_LENGTH); new sVictimName[MAX_NAME_LENGTH]; get_user_name(victim, sVictimName, MAX_NAME_LENGTH); new sWpnName[MAX_NAME_LENGTH]; xmod_get_wpnname(wpnindex, sWpnName, MAX_NAME_LENGTH);
why not using charsmax(sKillerName) , charsmax(sVictimName) , charsmax(sWpnName) ?
Code:
format(sMessage, MAX_COMMAND_LENGTH, "\*\*\* %s killed %s with a headshot from %s \*\*\*", sKillerName, sVictimName, sWpnName); } else { format(sMessage, MAX_COMMAND_LENGTH, "%s killed %s with %s", sKillerName, sVictimName, sWpnName);
why not formatex() ?

iceeedr 09-10-2019 09:07

Re: AMX Chat Relay [Discord <=> Ingame]
 
Why not?

PHP Code:

 formatex(sMessageMAX_COMMAND_LENGTH"\*\*\* %n killed %n with a headshot from %s \*\*\*"killervictimsWpnName);
}
else
{
formatex(sMessageMAX_COMMAND_LENGTH"%n killed %n with %s"killervictimsWpnName); 

Since it is for using the functions of amx 1.9 + ...

endnch 09-10-2019 11:57

Re: AMX Chat Relay [Discord <=> Ingame]
 
Quote:

Originally Posted by DON KHAN 1 (Post 2666489)
Very Nice plugin.
One thing there is 1.8.2 is latest version of amxmodx i have seen in amxmodx.org so u should make this plugin work on 1.8.2.
BTW its very nice plugin.

I actually started developing it in 1.8 but when I got to creating the cvars I said "screw this" and switched to 1.10. Anyhow I added a 1.8 compatible version, it has no cvars so to configure it you have to modify the source and compile the plugin yourself. Also the messages coming from discord won't have any color.

Quote:

Originally Posted by OciXCrom (Post 2666502)
Word of advice - maybe a better name for the plugin will be "AMXX Chat Relay". AMX is a very old and no longer supported version of AMXX.

PS: you don't need to include "amxconst" and "cvars" manually - they are already included in "amxmodx".

Changed the plugin name and removed the includes.

Quote:

Originally Posted by LearninG (Post 2666512)
why not using charsmax(sKillerName) , charsmax(sVictimName) , charsmax(sWpnName) ?

I fixed that, thanks.

Quote:

Originally Posted by LearninG (Post 2666512)
why not formatex() ?

Quote:

Originally Posted by iceeedr (Post 2666523)
Why not?
Since it is for using the functions of amx 1.9 + ...

Is formatex really that much faster than format? I changed it anyways.


All times are GMT -4. The time now is 22:22.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.