Merge pull request #2 from zeelorenc/master

Merge
This commit is contained in:
Dusan 2019-05-30 11:13:08 +02:00 committed by GitHub
commit 218d77d9f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 66 additions and 35 deletions

View File

@ -5,9 +5,13 @@
* Purpose: commands that can be used on the discord channel * Purpose: commands that can be used on the discord channel
*/ */
/* ** Error Checking ** */
#if defined DISCORD_DISABLED
#endinput
#endif
/* ** Includes ** */ /* ** Includes ** */
#include < YSI\y_hooks > #include < YSI\y_hooks >
#include < discord-command >
/* ** Commands ** */ /* ** Commands ** */
DISCORD:commands( DCC_Channel: channel, DCC_User: author, params[ ] ) DISCORD:commands( DCC_Channel: channel, DCC_User: author, params[ ] )

View File

@ -5,11 +5,24 @@
* Purpose: discord implementation in-game * Purpose: discord implementation in-game
*/ */
/* ** Enable or disable discord ** */
// #define DISCORD_DISABLED // !!!! DISABLED BY DEFAULT !!!! // #define DISCORD_DISABLED // !!!! DISABLED BY DEFAULT !!!!
/* ** Includes ** */ /* ** Includes ** */
#include < YSI\y_hooks > #include < YSI\y_hooks >
#include < discord-connector > #tryinclude < discord-connector >
#tryinclude < discord-command >
/* ** Disable if discord connector not enabled ** */
#if !defined dcconnector_included && !defined DISCORD_DISABLED
#warning "Discord is disabled as the connector is not found. (https://github.com/maddinat0r/samp-discord-connector)"
#define DISCORD_DISABLED
#endif
#if !defined _discordcmd_included && !defined DISCORD_DISABLED
#warning "Discord is disabled as the command handler is not found. (https://github.com/AliLogic/discord-command)"
#define DISCORD_DISABLED
#endif
/* ** Definitions ** */ /* ** Definitions ** */
/* Guild */ /* Guild */
@ -56,23 +69,33 @@ new stock
DCC_Role: discordRoleMember DCC_Role: discordRoleMember
; ;
stock DCC_SendChannelMessageFormatted( DCC_Channel: channel, const format[ ], va_args< > ) {
return DCC_SendChannelMessage( channel, va_return( format, va_start< 2 > ) );
}
/* ** Error Checking ** */ /* ** Error Checking ** */
#if defined DISCORD_DISABLED #if defined DISCORD_DISABLED
stock DCC_SendChannelMessage( DCC_Channel: channel, const message[ ] ) { stock TMP_DCC_SendChannelMessage( DCC_Channel: channel, const message[ ] ) {
#pragma unused channel #pragma unused channel
#pragma unused message #pragma unused message
return 1; return 1;
} }
#if defined _ALS_DCC_SendChannelMessage
#undef DCC_SendChannelMessage
#else
#define _ALS_DCC_SendChannelMessage
#endif
#define DCC_SendChannelMessage TMP_DCC_SendChannelMessage
stock DCC_SendUserMessage( DCC_User: author, const message[ ] ) stock DCC_SendUserMessage( DCC_User: author, const message[ ] )
{ {
#pragma unused author #pragma unused author
#pragma unused message #pragma unused message
return 1; return 1;
} }
stock DCC_SendChannelMessageFormatted( DCC_Channel: channel, const format[ ], va_args< > ) {
#pragma unused channel
#pragma unused format
return 1;
}
#endinput #endinput
#endif #endif
@ -167,3 +190,7 @@ public DCC_OnGuildMemberAdd(DCC_Guild:guild, DCC_User:user)
DCC_SendUserUsage(user, "Hey there! I am **Stephanie**, i am here to help you out!\nUse **!commands** to see all commands i offer.\nYou need to have **member** role trough to use them, so first verify your account!"); DCC_SendUserUsage(user, "Hey there! I am **Stephanie**, i am here to help you out!\nUse **!commands** to see all commands i offer.\nYou need to have **member** role trough to use them, so first verify your account!");
return 1; return 1;
} }
stock DCC_SendChannelMessageFormatted( DCC_Channel: channel, const format[ ], va_args< > ) {
return DCC_SendChannelMessage( channel, va_return( format, va_start< 2 > ) );
}