SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 09/08/2017, 03:35 PM   #1
baki
Little Clucker
 
Join Date: Jun 2011
Location: Serbia and Monterego
Posts: 32
Reputation: 0
Default Discord Help

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;

__________________
I HATE HACKERS!!
baki is offline   Reply With Quote
Old 09/08/2017, 04:06 PM   #2
Xeon™
Banned
 
Join Date: Jul 2017
Location: Earth
Posts: 461
Reputation: 96
Default Re: Discord Help

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

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

DCC_FindChannelByName(name[])
Xeon™ is offline   Reply With Quote
Old 09/08/2017, 04:13 PM   #3
baki
Little Clucker
 
Join Date: Jun 2011
Location: Serbia and Monterego
Posts: 32
Reputation: 0
Default Re: Discord Help

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?
__________________
I HATE HACKERS!!
baki is offline   Reply With Quote
Old 09/08/2017, 08:27 PM   #4
baki
Little Clucker
 
Join Date: Jun 2011
Location: Serbia and Monterego
Posts: 32
Reputation: 0
Default Re: Discord Help

bump
__________________
I HATE HACKERS!!
baki is offline   Reply With Quote
Old 09/08/2017, 10:28 PM   #5
baki
Little Clucker
 
Join Date: Jun 2011
Location: Serbia and Monterego
Posts: 32
Reputation: 0
Default Re: Discord Help

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...
__________________
I HATE HACKERS!!
baki 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
Discord for SA-MP? Lorenc_ Plugin Development 83 05/02/2017 07:01 PM


All times are GMT. The time now is 02:20 PM.


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