Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] DISCORD Chat - SERVER Chat

 
  • 0 Vote(s) - 0 Average
Pawn DISCORD Chat - SERVER Chat
Sean17
Offline

Burgershot Member
Posts: 5
Threads: 3
Joined: May 2019
Reputation: 0
Location: Philippines
#1
2020-05-16, 08:55 AM
I'l trying to make a Discord - Server chat here's my code:
Code:
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 userid1[20+1];
DCC_GetUserId(author, userid1);
if(!strcmp(userid1, CHANNEL_ID)) return 0;

    if(channel != BotChannel) return 0;

new str[145];
format(str, sizeof str, "{667aca}[Discord] %s:{ffffff} %s", user_name, message);
    for(new i = 0; i < MAX_PLAYERS; i++) {
    SendClientMessage(i, -1, str); }
    return 1;
 }
It dosn't work and also don't have errors...
Josh
Offline

Administrator

Posts: 129
Threads: 1
Joined: Feb 2019
Reputation: 20
#2
2020-05-17, 05:24 AM
You need to be more specific:

What doesn't work?
What have you tried?
What are you expecting the code to do?
Sean17
Offline

Burgershot Member
Posts: 5
Threads: 3
Joined: May 2019
Reputation: 0
Location: Philippines
#3
2020-05-17, 05:44 AM
What doesn't work?
Players can't see the messages sent in the discord server

What have you tried?
I tried only that code

What are you expecting the code to do?
When I chat in discord it will SenClientMessageToAll in-Game.
Steven
Offline

Burgershot Member
Posts: 4
Threads: 2
Joined: Oct 2019
Reputation: 0
Location: Pakistan
#4
2020-05-24, 03:11 PM
Well the thing is OnChannelMessage is deprecated, use the latest one OnMessageCreate and then fetch all info from DCC_Message ..
Eternal Life Roleplay - An upcoming unique RP server based in Palomino Creek

!damo!spiderman Wrote:You're pathetic. Stand for something that's going to help the world rather than fill it with more hate. Give someone a hug, tell someone you care... Do something, do anything but do it with love not hate.

XoMoX
Offline

Burgershot Member
Posts: 26
Threads: 4
Joined: May 2020
Reputation: 1
Location: Philippines
#5
2020-06-23, 07:00 AM (This post was last modified: 2020-06-23, 07:00 AM by XoMoX.)
that DCC_OnChannelMessage is long gone and has been replaced
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode