• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Plugin] Discord Connector invalid message author.
#1
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(messagemsgChannel);



    new 
channelName[128];

    
DCC_GetChannelName(msgChannelchannelNamesizeof(channelName));



    
printf("channelName: %s"channelName);

    if(
strcmp(channelName"sa-mp"true5) == 0)

    {

        new 
DCC_User:author;

        
DCC_GetMessageAuthor(messageauthor); // This always fails



        
if(author == DCC_INVALID_USER)

        {

            print(
"Invalid User");

            return;

        }

        

        new 
bool:IsBotbool:IsVerified;

        
DCC_IsUserBot(authorIsBot);

        
DCC_IsUserVerified(authorIsVerified);

        

        new 
authorName[DCC_USERNAME_SIZE];

        
DCC_GetUserName(authorauthorNamesizeof(authorName));



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



        if(!
IsBot && IsVerified)

        {

            new 
string[128];

            new 
authorMessage[128];

            
DCC_GetMessageContent(messageauthorMessagesizeof(authorMessage));

            

            
format(stringsizeof(string), "[Discord/%s]: %s"authorNameauthorMessage);

            
SendClientMessageToAll(0x00C7FFAAstring);

        }

    }


  Reply
#2
Does this always print "Invalid User"?
Check out Desolation Roleplay, where zombie AI and scavenging is bothered by player bandits!


  Reply
#3
Yes, it always prints invalid user.
  Reply
#4
Upgrade to 0.3.4, it will tell you what is wrong.
  Reply
#5
Thanks missed the intend setting.
  Reply


Forum Jump: