Posts: 77
Threads: 14
Joined: Jul 2016
Reputation:
0
Whenever I type any command on Discord, the output (which Is sent by the bot) is shown in game chat, Along with Connect and Disconnect Messages. I only want player messages, the ones which players input, to be seen in game and not the bot messages. Is there any way to do so? If Yes, Kindly tell me. Also, Is there any way to make specific permissions for each Discord role, like for e.g Connect messages are only sent to Ones having a role "admins or owners" and not to someone else. Thanks.
Regards,
Posts: 180
Threads: 3
Joined: Mar 2018
An example how to disable bot messages:
PHP код:
#define BOT_NAME "YourBotName"
public DCC_OnChannelMessage(DCC_Channel:channel, DCC_User:author, const message[])
{
new channel_name[100 + 1], user_name[32 + 1], user[24];
if(!DCC_GetChannelName(channel, channel_name)) return 0; // invalid channel
if(!DCC_GetUserName(author, user_name)) return 0; // invalid user
DCC_GetUserName(DCC_User:author, user, 24);
if(!strcmp(user, BOT_NAME)) return 0; // Don't show bot messages in chat
}
You can make a different channel and restric it's access to admins only and send messages to that channel.
Posts: 180
Threads: 3
Joined: Mar 2018
Posts: 180
Threads: 3
Joined: Mar 2018
It could be a disable option for messages or something similar.
Anyways..
PHP код:
#define BOT_NAME "YourBotName"
public DCC_OnChannelMessage(DCC_Channel:channel, DCC_User:author, const message[])
{
new channel_name[100 + 1];
if(!DCC_GetChannelName(channel, channel_name)) return 0; // invalid channel
new user_name[32 + 1];
if (!DCC_GetUserName(author, user_name)) return 0; // invalid user
if(!strcmp(user_name, BOT_NAME)) return 0; // Don't show bot messages in chat
new str[128];
format(str, sizeof str, "{667ACA}[Discord]%s:{FFFFFF} %s", user_name, message);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(DiscordStats[i] != 0);
SendClientMessage(i, -1, str);
}
return 1;
}
Posts: 180
Threads: 3
Joined: Mar 2018
Move SendClientMessage(i, -1, str); one tab left