View Single Post
Old 24/12/2017, 08:54 PM   #1
Huge Clucker
Inn0cent's Avatar
Join Date: May 2013
Location: Pakistan
Posts: 353
Reputation: 45
Default DCC - Discord Command Controller.

DCC - Discord Command Controller

Hi, As stated above this include is basically discord command controller. Where you can make commands easily just by using DC_CMD:.. like CMD:.., It uses DCC_OnChannelMessage callback to fetch commands. If you do not know about the discord plugin please learn about it first. Click Here and then come back here..

How to?


PHP Code:
forward OnDCCommandPerformed(args[], success);        
forward SendDC(channel[], const fmat[], va_args<>); 
I have added a SendDC callback which sends the message to channel directly without doing the format stuff. It uses y_va so you need it.
PHP Code:
SendDC(CHANNEL_ID"%s has joined the server."name); 
CHANNEL_ID is your Bot channel id which you can change later in script.

The callback
OnDCCommandPerformed(args[], success)
is called after the command execution if success == 0 means the command is not executed or doesn't exists. For Example,
PHP Code:
public OnDCCommandPerformed(args[], success)
success) return SendDC(CHANNEL_ID"```js\nInvalid command..!\n```");

Setting Up
Add That on the top of your script,
PHP Code:
#define CMD_PREFIX "!"
#define BOT_CHANNEL ""
#define BOT_NAME ""
#define CHANNEL_ID "" 
and change it to the way you want. CMD_PREFIX tells which prefix to use like @test or !test and after that include the DCC include.
#include <dcc>
Adding Commands
PHP Code:
sscanf(args"s[50]"msg)) return SendDC(CHANNEL_ID""CMD_PREFIX"m [Msg]");
SendDC(CHANNEL_ID"%s: %s"usermsg);

Please report any bug you found or tell me anything u want in this include. I will really Appreciate it.
I have also added the test.pwn to make it more easy for you guys in the rar.

Discord Connector Plugin -
sscanf2 plugin.
Attached Files
File Type: rar dcc.rar (915.4 KB, 870 views)
Inn0cent is offline   Reply With Quote