SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 26/05/2020, 03:03 PM   #1
Huge Clucker
Join Date: May 2016
Posts: 251
Reputation: 1
Question Discord DCC_GetRoleName

How can i get the 'rolename'?
pawn Code:
forward DCC_OnMessageCreate(DCC_Message:message);
public DCC_OnMessageCreate(DCC_Message:message)
    new realMsg[100];
    DCC_GetMessageContent(message, realMsg, 100);
    new bool:IsBot;
    new DCC_Channel:channel;
    DCC_GetMessageChannel(message, channel);
    new DCC_User:author;
    DCC_GetMessageAuthor(message, author);
    //==================I'm confused with this==================================
    new DCC_Role:role, rolename[128];//<<<<<<<<<<<<<<<<<<<<
    DCC_GetRoleName(role, rolename, 128);//<<<<<<<<<<<<<<<<<<<<
    DCC_IsUserBot(author, IsBot);
    if(IsBot) return 1;
    new discordstr[256];
    new command[32], params[128];
    DCC_GetMessageContent(message, discordstr);
    sscanf(discordstr, "s[32]s[128]", command, params);
    if(channel == g_Discord_Admin_CMD)
        if(!strcmp(command, "!mycommand", true)) {
            if(rolename == g_Role_Level_1 || rolename == g_Role_Level_2 || rolename == g_Role_Level_3 || rolename == g_Role_Level_4) {//<<<<<<<<<<<<<<<<<<<<<<<<
                //My actions
            } else return DCC_SendChannelMessage(g_Discord_Admin_CMD, "```ERROR: You are not a high enough level to use this command```");
    return 1;
error 033: array must be indexed (variable "rolename")
I tried it some ways, and still getting errors.
Filbert is offline   Reply With Quote

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
[FilterScript] Discord Admin Control Panel - Manage players through discord! Exhibit Filterscripts 34 12/08/2020 04:28 PM
[FilterScript] Discord Chat - Real time chatting ( Discord + In Game) Exhibit Filterscripts 36 16/10/2019 08:32 PM
[Ajuda] Discord Syxh0wN Português/Portuguese 6 24/03/2019 11:46 PM
Discord for SA-MP? Lorenc_ Plugin Development 83 05/02/2017 07:01 PM

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

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