can i do this? (||)
#5

1 more question..
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);
    //=================This is what i dont get==================================
    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;
}
Code:
error 033: array must be indexed (variable "rolename")
I tried it some ways, and still getting errors.
Reply


Messages In This Thread
can i do this? (||) - by Filbert - 26.05.2020, 09:30
Re: can i do this? (||) - by SharpenBlade - 26.05.2020, 09:48
Re: can i do this? (||) - by Filbert - 26.05.2020, 10:11
Re: can i do this? (||) - by Kwarde - 26.05.2020, 10:22
Re: can i do this? (||) - by Filbert - 26.05.2020, 12:03

Forum Jump:


Users browsing this thread: 1 Guest(s)