03.04.2018, 14:44
Hey. I've added some commands with the discord connector like /dchaton and /dchatoff to toggle between the Discord Chat but only id 0 is able to see the messages that are sent from discord to the samp server.
Code:
I want the it to show the messages to everyone who have Discord chat turned on but not the ones who don't have it on.
Code:
PHP код:
public DCC_OnChannelMessage(DCC_Channel:channel, DCC_User:author, const message[])
{
new channel_name[100 + 1];
if(!DCC_GetChannelName(channel, channel_name))
return 0;
new user_name[32 + 1];
if (!DCC_GetUserName(author, user_name))
return 0;
new str[145];
format(str, sizeof str, "{667aca}[Discord/%s] %s:{ffffff} %s", channel_name, user_name, message);
for(new i = 0; i < MAX_PLAYERS; i++){
if (DiscordStats[i]==0) return 0;
SendClientMessage(i, -1, str); }
return 1;
}