17.06.2014, 08:41
(
Последний раз редактировалось iFarbod; 17.06.2014 в 08:52.
Причина: comments
)
pawn Код:
ICMD:acmds(playerid, params[])
{
new
str[1024];
if(!pInfo[playerid][pAdminLevel]) return 0;
format(str, sizeof(str), CCE_HLDEFAULT"*** LSGB Admin Commands ***\n"CCE_HLGREEN"Your admin level :"CCE_HLPURPLE" [%d - %s]\n\n", pInfo[playerid][pAdminLevel], GetPlayerAdminLevel(playerid));
for(new i = 0; i != pInfo[playerid][pAdminLevel]; ++i)
{
if(pInfo[playerid][pAdminLevel] > 1) strcat(str, FWTE_AQUAMARINE"* Admin Level 1 (Trial Moderator): /slap /akill /slay /explode /asay /burn /an(nounce) /spec(off)\n");
else if(pInfo[playerid][pAdminLevel] > 2) strcat(str, FWTE_AQUAMARINE"* Admin Level 2 (Moderator): /slap /akill /slay /explode /asay /burn /an(nounce) /spec(off)\n");
else if(pInfo[playerid][pAdminLevel] > 3) strcat(str, FWTE_AQUAMARINE"* Admin Level 3 (Global Moderator): /slap /akill /slay /explode /asay /burn /an(nounce) /spec(off)\n");
else if(pInfo[playerid][pAdminLevel] > 4) strcat(str, FWTE_AQUAMARINE"* Admin Level 4 (Master Administrator): /slap /akill /slay /explode /asay /burn /an(nounce) /spec(off)\n");
else if(pInfo[playerid][pAdminLevel] > 5) strcat(str, FWTE_AQUAMARINE"* Admin Level 5 (Senior Administrator): /slap /akill /slay /explode /asay /burn /an(nounce) /spec(off)\n");
else if(pInfo[playerid][pAdminLevel] > 6) strcat(str, FWTE_AQUAMARINE"* Admin Level 6 (Lead Administrtaor): /slap /akill /slay /explode /asay /burn /an(nounce) /spec(off)\n");
else if(pInfo[playerid][pAdminLevel] > 7) strcat(str, FWTE_AQUAMARINE"* Admin Level 7 (Deputy Head Administrator): /slap /akill /slay /explode /asay /burn /an(nounce) /spec(off)\n");
else if(pInfo[playerid][pAdminLevel] > 8) strcat(str, FWTE_AQUAMARINE"* Admin Level 8 (Head Administrator): /slap /akill /slay /explode /asay /burn /an(nounce) /spec(off)\n");
else if(pInfo[playerid][pAdminLevel] > 9) strcat(str, FWTE_AQUAMARINE"* Admin Level 9 (Co-Owner): /slap /akill /slay /explode /asay /burn /an(nounce) /spec(off)\n");
else if(pInfo[playerid][pAdminLevel] > 10) strcat(str, FWTE_AQUAMARINE"* Admin Level 10 (Founder): /slap /akill /slay /explode /asay /burn /an(nounce) /spec(off)\n");
}
ShowPlayerDialog(playerid, DIALOG_ACMDS, DIALOG_STYLE_MSGBOX, IE_PRIMARY"LSGB Admin Commands", str, "Okay", "");
return 1;
}
like this, if i am a level 3 admin, level 1, 2, 3 show for me.
if i am a level 5 admin, level 1, 2, 3, 4, 5 listed for me.
- also for Using ICMD instead of CMD:
pawn Код:
#define ICMD:%1(%2) \
COMMAND:%1(%2)
Problem: As i posted the code. just level 1 will be listed for me based on my level.
if i am level 3, level 1 will be listed for me 3 times.