SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 24/12/2017, 08:54 PM   #1
Inn0cent
Huge Clucker
 
Inn0cent's Avatar
 
Join Date: May 2013
Location: Pakistan
Posts: 354
Reputation: 45
Default DCC - Discord Command Controller.

DCC - Discord Command Controller

Intro
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?

CallBacks

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
Code:
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)
{
    if(!
success) return SendDC(CHANNEL_ID"```js\nInvalid command..!\n```");
    return 
1;

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.
Code:
#include <dcc>
Adding Commands
Example:
PHP Code:
DC_CMD:m(userargs)
{
     new 
msg[50];
    if(
sscanf(args"s[50]"msg)) return SendDC(CHANNEL_ID""CMD_PREFIX"m [Msg]");
    
SendDC(CHANNEL_ID"%s: %s"usermsg);
    return 
1;

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.

Requirements!
Discord Connector Plugin - http://forum.sa-mp.com/showthread.php?t=631562
YSI/y_ya.
sscanf2 plugin.
Attached Files
File Type: rar dcc.rar (915.4 KB, 581 views)
__________________
Inn0cent is offline   Reply With Quote
Old 24/12/2017, 09:10 PM   #2
Barnwell
Banned
 
Join Date: May 2014
Location: England
Posts: 555
Reputation: 40
Default Re: DCC - Discord Command Controller.

Awesome!
Barnwell is offline   Reply With Quote
Old 25/12/2017, 04:30 AM   #3
StrikerZ
High-roller
 
StrikerZ's Avatar
 
Join Date: Mar 2016
Location: Asgard
Posts: 1,056
Reputation: 154
Default Re: DCC - Discord Command Controller.

Cool
__________________
StrikerZ is offline   Reply With Quote
Old 18/01/2018, 11:52 AM   #4
SeanDenZYR
Big Clucker
 
Join Date: May 2016
Posts: 168
Reputation: 20
Default Re: DCC - Discord Command Controller.

a substitute to IRC. Nice. Plus Discord is easier to use. +rep.
SeanDenZYR is offline   Reply With Quote
Old 18/01/2018, 01:11 PM   #5
SeanDenZYR
Big Clucker
 
Join Date: May 2016
Posts: 168
Reputation: 20
Default Re: DCC - Discord Command Controller.

[mention]Inn0cent[/mention], is there a way to check if a player uses this role? like for example:
if(PlayerInfo[playerid][DISCORD ROLE])
SeanDenZYR is offline   Reply With Quote
Old 18/01/2018, 01:46 PM   #6
Inn0cent
Huge Clucker
 
Inn0cent's Avatar
 
Join Date: May 2013
Location: Pakistan
Posts: 354
Reputation: 45
Default Re: DCC - Discord Command Controller.

Quote:
Originally Posted by SeanDenZYR View Post
[mention]Inn0cent[/mention], is there a way to check if a player uses this role? like for example:
if(PlayerInfo[playerid][DISCORD ROLE])
No, I haven't added the role thing in this include yet, but i will do so. Btw you can read about roles on Main Plugin Thread.
__________________
Inn0cent is offline   Reply With Quote
Old 19/01/2018, 10:20 AM   #7
DeitY
Huge Clucker
 
DeitY's Avatar
 
Join Date: Aug 2012
Location: Serbia
Posts: 322
Reputation: 14
Default Re: DCC - Discord Command Controller.

Awesome script, too sad not so many communities use discord, neither me myself ;/
__________________
Kasno je za oprostaj ; )

DeitY is offline   Reply With Quote
Old 29/01/2018, 10:08 AM   #8
Unkovic
Big Clucker
 
Unkovic's Avatar
 
Join Date: Sep 2017
Posts: 93
Reputation: 14
Default Re: DCC - Discord Command Controller.

Good job

Quote:
Originally Posted by DeitY View Post
Awesome script, too sad not so many communities use discord, neither me myself ;/
Jeste jeste xD
Unkovic is offline   Reply With Quote
Old 22/02/2018, 05:28 PM   #9
waysemir
Little Clucker
 
Join Date: Oct 2014
Posts: 39
Reputation: 3
Default Re: DCC - Discord Command Controller.

C:\test\pawno\include\dcc.inc(37) : error 017: undefined symbol "BOT_NAME"
C:\test\pawno\include\dcc.inc(39) : error 017: undefined symbol "BOT_CHANNEL"
C:\test\pawno\include\dcc.inc(46) : error 017: undefined symbol "CMD_PREFIX"
waysemir is offline   Reply With Quote
Old 22/02/2018, 05:31 PM   #10
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Sweden
Posts: 2,315
Reputation: 167
Default Re: DCC - Discord Command Controller.

Awesome work i will test this.
__________________
Here is my discord server https://discord.gg/ucVpDkJ
N0FeaR is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Discord Connector baki Scripting Help 3 25/06/2018 12:03 PM
Discord Help baki Scripting Help 4 09/08/2017 10:28 PM
Discord for SA-MP? Lorenc_ Plugin Development 83 05/02/2017 07:01 PM


All times are GMT. The time now is 08:45 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.