26.05.2020, 15:03
How can i get the 'rolename'?
I tried it some ways, and still getting errors.
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;
}
Code:
error 033: array must be indexed (variable "rolename")