SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 22/05/2018, 11:11 PM   #161
JR_Junior
Huge Clucker
 
Join Date: Nov 2011
Location: Brazil
Posts: 203
Reputation: 47
Default Re: Discord Connector

Quote:
Originally Posted by Kaperstone View Post
Try to insert @Username#UserTag or <@!UserId> and see your luck
Quote:
Originally Posted by maddinat0r View Post
As Kaperstone correctly stated, "<@!UserId>" (without the quotes) is the correct syntax.
Thank you all!
JR_Junior is offline   Reply With Quote
Old 23/05/2018, 07:08 AM   #162
JR_Junior
Huge Clucker
 
Join Date: Nov 2011
Location: Brazil
Posts: 203
Reputation: 47
Default Re: Discord Connector

The following code is returning invalid data:
PHP Code:
    #define Loop(%0,%1,%2) for(new %0 = %2; %0 < %1; %0++)
    
    
new DCC_Guild:server DCC_FindGuildById(DISCORD_SERVER_ID);
    if(
server == DCC_INVALID_GUILD) return 0;

    new 
members,official,bool:has_role,channels,countchannels,countcategory;

    new 
DCC_Role:official_role DCC_FindRoleById(DISCORD_OFFICIAL_ROLE_ID);

    
DCC_GetGuildMemberCount(servermembers);
    
DCC_GetGuildChannelCount(serverchannels);

    
Loop(ichannels0)
    {
        new 
DCC_Channel:channel,DCC_ChannelType:type;
        
DCC_GetGuildChannel(serverichannel);
        
DCC_GetChannelType(channeltype);
        if(
type != GUILD_CATEGORYcountchannels++;
        else 
countcategory++;
    }
    
Loop(imembers0)
    {
        new 
DCC_User:member;
        
DCC_GetGuildMember(serverimember);
        
DCC_HasGuildMemberRole(servermemberofficial_rolehas_role);
        if(
has_roleofficial++;
    } 
members = 8 (but the server has only 6)
official = 5 (but the server has only 4 members in the role "Official Member")
countchannels = 7 (but the server has 13 non category channels)
countcategory = 0 (but the server has 7 category channels)

Am I doing something wrong?
JR_Junior is offline   Reply With Quote
Old 23/05/2018, 07:41 AM   #163
QuaTTrO
Gangsta
 
QuaTTrO's Avatar
 
Join Date: Aug 2009
Posts: 574
Reputation: 75
Default Re: Discord Connector

Is your bot in more than one guild?
__________________


QuaTTrO is offline   Reply With Quote
Old 23/05/2018, 05:17 PM   #164
JR_Junior
Huge Clucker
 
Join Date: Nov 2011
Location: Brazil
Posts: 203
Reputation: 47
Default Re: Discord Connector

Quote:
Originally Posted by QuaTTrO View Post
Is your bot in more than one guild?
Only 1
JR_Junior is offline   Reply With Quote
Old 24/05/2018, 12:36 AM   #165
JR_Junior
Huge Clucker
 
Join Date: Nov 2011
Location: Brazil
Posts: 203
Reputation: 47
Default Re: Discord Connector

Another problem:
PHP Code:
new email[128];
new 
DCC_User:user DCC_FindUserByName("My_Name, "5231");
DCC_GetUserEmail(user, email);
printf("
Email: %s",email);

result: 
Email: (empty string) 
JR_Junior 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
[Plugin] Teamspeak Connector maddinat0r Plugin Development 322 09/02/2018 11:53 AM
Route Connector James_Braga Русский/Russian 9 15/05/2015 08:24 AM
[Map] Connector Gas Tellken Maps 4 01/06/2012 03:04 AM
PSU connector help! patchkinson Everything and Nothing 3 20/03/2010 09:24 PM


All times are GMT. The time now is 11:35 PM.


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