Discord Help
#1

Anyone can help me i can see the player\'s messages from discord IG but i dont see the In Game messages in Discord if you understand me is there any way to make the in game messages appear in Discord? I would be thankful if you helped me



OnPlayerSpawn
PHP Code:
        new name[MAX_PLAYER_NAME 1];
    
GetPlayerName(playeridnamesizeof name);

    if (
_:g_WelcomeChannelId == 0)
        
g_WelcomeChannelId DCC_FindChannelById("344516361097052161"); // Discord channel ID

    
new str[128];
    
format(strsizeof str"Player %s joined the server."name);
    
DCC_SendChannelMessage(g_WelcomeChannelIdstr); 
PHP Code:
public DCC_OnChannelMessage(DCC_Channel:channel, const author[], const message[])
{

    new 
tmp144 ];
    
format(tmpsizeof (tmp), "[discord: %s]: {FFFFFF}%s"authormessage);
    
SendClientMessageToAll(-1tmp);
    return 
true;

Reply
#2

Hello.
this code is fine. what\'s your problem?

also i\'d recommand to use name instand of Channel id.

DCC_FindChannelByName(name[])
Reply
#3

Quote:
Originally Posted by XeonMaster
View Post
Hello.

this code is fine. what\'s your problem?


also i\'d recommand to use name instand of Channel id.


DCC_FindChannelByName(name[])
I can only receive bot message when somebody join from IG server in Discord also the server receives Discord messages to IG


I want IG player messages to be sent in Discord if you understand

can you help me with this?
Reply
#4

bump
Reply
#5

So solved this with this


OnPlayerText

PHP Code:
  new name[MAX_PLAYER_NAME 1];
    
GetPlayerName(playeridnamesizeof name);

    
g_PlayerTypes DCC_FindChannelByName("echo_channel"); // Discord channel ID
    
new str3[128];
    
format(str3sizeof(str3), "[Server] %s: %s"nametext[1]);
    
DCC_SendChannelMessage(g_PlayerTypesstr3);
    return 
1
It sends messages pretty great now...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)