Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Plugin] Discord Connector invalid message author.

 
  • 0 Vote(s) - 0 Average
Plugin Discord Connector invalid message author.
XeroX
Offline

Burgershot Member
Posts: 12
Threads: 3
Joined: Apr 2019
Reputation: 0
Location: Germany
#1
2020-11-03, 04:47 PM
Hi,

it's been sometime since I last scritped for sa-mp. Anyway my problem is that DCC_GetMessageAuthor returns an invalid user and I'm not entirely sure why.
Plugin version is 0.3.3

PHP Code:
public DCC_OnMessageCreate(DCC_Message:message)
{
    new 
DCC_Channel:msgChannel;
    
DCC_GetMessageChannel(message, msgChannel);

    new 
channelName[128];
    
DCC_GetChannelName(msgChannel, channelName, sizeof(channelName));

    
printf("channelName: %s", channelName);
    if(
strcmp(channelName, "sa-mp", true, 5) == 0)
    {
        new 
DCC_User:author;
        
DCC_GetMessageAuthor(message, author); // This always fails

        
if(author == DCC_INVALID_USER)
        {
            print(
"Invalid User");
            return;
        }
        
        new 
bool:IsBot, bool:IsVerified;
        
DCC_IsUserBot(author, IsBot);
        
DCC_IsUserVerified(author, IsVerified);
        
        new 
authorName[DCC_USERNAME_SIZE];
        
DCC_GetUserName(author, authorName, sizeof(authorName));

        
printf("Author: %s | IsBot: %d | IsVerified: %d", authorName, IsBot, IsVerified );

        if(!
IsBot && IsVerified)
        {
            new 
string[128];
            new 
authorMessage[128];
            
DCC_GetMessageContent(message, authorMessage, sizeof(authorMessage));
            
            
format(string, sizeof(string), "[Discord/%s]: %s", authorName, authorMessage);
            
SendClientMessageToAll(0x00C7FFAA, string);
        }
    }
} 
Awide
Offline

Burgershot Member
Posts: 62
Threads: 5
Joined: Sep 2019
Reputation: 5
#2
2020-11-03, 05:59 PM
Does this always print "Invalid User"?
Desolation Roleplay has closed. You can download the gamemode here: https://www.burgershot.gg/showthread.php?tid=2272
XeroX
Offline

Burgershot Member
Posts: 12
Threads: 3
Joined: Apr 2019
Reputation: 0
Location: Germany
#3
2020-11-03, 08:46 PM
Yes, it always prints invalid user.
Josh
Offline

Administrator

Posts: 129
Threads: 1
Joined: Feb 2019
Reputation: 20
#4
2020-11-03, 11:06 PM
Upgrade to 0.3.4, it will tell you what is wrong.
XeroX
Offline

Burgershot Member
Posts: 12
Threads: 3
Joined: Apr 2019
Reputation: 0
Location: Germany
#5
2020-11-03, 11:22 PM
Thanks missed the intend setting.
« 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