21.05.2016, 14:17
Sup guys I need to know when a admin type /acmds he show commands admin but I want make if player level 1 show him only level 1 commands and 2same but how did we can do it??
CMD:acmds(playerid)
{
if(adminvariable[playerid]==1)//level 1 admin
//show his cmds here in a dialog
if(adminvar[playerid]==2)//level 2
//same as above
return 1;
}
if (pInfo[playerid][AdminLevel] < 2)
{
//show 1 level admin cmds
}
if (pInfo[playerid][AdminLevel] < 3)
{
//show 2 level admin cmds
}
System.pwn(311) : error 017: undefined symbol "pInfo" System.pwn(311) : warning 215: expression has no effect System.pwn(311) : error 001: expected token: ";", but found "]" System.pwn(311) : error 029: invalid expression, assumed zero System.pwn(311) : fatal error 107: too many error messages on one line
CMD:acmds(playerid)
{
if(pInfo[playerid][AdminLevel] < 1)
{
ShowPlayerDialog(playerid, DIALOG_1, DIALOG_STYLE_MSGBOX, "Admin Commands Level 1","Soon Commands Added","Close");
}
if(pInfo[playerid][AdminLevel] < 2)
{
ShowPlayerDialog(playerid, DIALOG_2, DIALOG_STYLE_MSGBOX, "Admin Commands Level 2","Soon Commands Added","Close");
}
if(pInfo[playerid][AdminLevel] > 3)
{
ShowPlayerDialog(playerid, DIALOG_3, DIALOG_STYLE_MSGBOX, "Admin Commands Level 3","/Kick , Added More Soon","Close");
}
if(pInfo[playerid][AdminLevel] > 4)
{
ShowPlayerDialog(playerid, DIALOG_4, DIALOG_STYLE_MSGBOX, "Admin Commands Level 4","/ban , Added More Soon","Close");
}
return 1;
}
#define DIALOG_1 #define DIALOG_2 #define DIALOG_3 #define DIALOG_4
enum PlayerInfo
{
AdminLevel
//here you can add more stuff, such as Score, Cash and etc.
}
new pInfo [MAX_PLAYERS][PlayerInfo];
//Top of your script
#define strcpy(%0,%1) \
strcat((%0[0] = '\0', %0), %1)
CMD:acmds(playerid, params[])
{
new STR[1246+546];
if(Variables of Level 1)
{
strcat(STR, "Level 1\n");
strcat(STR, "Commands ..");
}
if(Variables of Level 2)
{
strcat(STR, "Level 2\n");
strcat(STR, "Commands ..");
}
ShowPlayerDialog(playerid, 5411 , DIALOG_STYLE_MSGBOX, "ADMIN CMDS", STR, "Close", "");
return 1;
}
C:\Users\Alomari\Desktop\New folder\System.pwn(173) : error 017: undefined symbol "PlayerInfo" C:\Users\Alomari\Desktop\New folder\System.pwn(173) : error 009: invalid array size (negative, zero or out of bounds) C:\Users\Alomari\Desktop\New folder\System.pwn(317) : warning 213: tag mismatch C:\Users\Alomari\Desktop\New folder\System.pwn(319) : warning 202: number of arguments does not match definition C:\Users\Alomari\Desktop\New folder\System.pwn(321) : warning 213: tag mismatch C:\Users\Alomari\Desktop\New folder\System.pwn(323) : warning 202: number of arguments does not match definition C:\Users\Alomari\Desktop\New folder\System.pwn(325) : warning 213: tag mismatch C:\Users\Alomari\Desktop\New folder\System.pwn(327) : warning 202: number of arguments does not match definition C:\Users\Alomari\Desktop\New folder\System.pwn(329) : warning 213: tag mismatch C:\Users\Alomari\Desktop\New folder\System.pwn(331) : warning 202: number of arguments does not match definition
its given me a errors Saw what i got
Код:
#define DIALOG_1 #define DIALOG_2 #define DIALOG_3 #define DIALOG_4 |
#define DIALOG_1 1