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
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);
}
}
}