View Single Post
Old 26/05/2020, 03:42 PM   #3
Filbert
Huge Clucker
 
Join Date: May 2016
Posts: 251
Reputation: 1
Default Re: Discord DCC_GetRoleName

Quote:
Originally Posted by SharpenBlade View Post
From what I see, your variable name rolename is an array. So the check should be like this:
So, is this already correct? Because i dont even think so.
pawn Code:
new DCC_Role:role, rolename[128];//<<<<<<<<<<<<<<<<<<<<
    DCC_GetRoleName(role, rolename, 128);//<<<<<<<<<<<<<<<<<<<<
I tried to get the 'author's role by this (check the code at the top to see 'author'):
pawn Code:
new rolename[128];
    DCC_GetRoleName(author, rolename, 128);
Which is the correct one? Or how can i make the correct one?

EDIT: This code :
pawn Code:
if(!strcmp(rolename, g_Role_Level_1, false)) {
    //My action
}
Shows this error :
Code:
error 035: argument type mismatch (argument 2)
EDIT: I got this :
pawn Code:
new DCC_Role:g_Role_Level_1;
new DCC_Role:g_Role_Level_2;
new DCC_Role:g_Role_Level_3;
new DCC_Role:g_Role_Level_4;
new DCC_Role:g_Role_Level_5;
new DCC_Role:g_Role_Level_6;
new DCC_Role:g_Role_Level_7;
new DCC_Role:g_Role_Level_8;
And this under OnGameModeInit()

pawn Code:
g_Role_Level_1 = DCC_FindRoleById("myroleid");
g_Role_Level_2 = DCC_FindRoleById("myroleid");
g_Role_Level_3 = DCC_FindRoleById("myroleid");
g_Role_Level_4 = DCC_FindRoleById("myroleid");
g_Role_Level_5 = DCC_FindRoleById("myroleid");
g_Role_Level_6 = DCC_FindRoleById("myroleid");
g_Role_Level_7 = DCC_FindRoleById("myroleid");
g_Role_Level_8 = DCC_FindRoleById("myroleid");
Filbert is offline   Reply With Quote