COMMAND:acmds(playerid, params[])
{
if(playerData[playerid][playerLoggedIn])
{
if(playerData[playerid][playerLevel] >= 1)
{
new string[1400];
format(string, sizeof(string), "%s{98B0CD}LEVEL 1 COMMANDS{51FF00}\n/goto /aod /kick /jail /asay /spawn /slap /warn\n/(un)freeze /playerstats /spec /specoff /rarb\n\n", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL1, DIALOG_STYLE_MSGBOX, "Admin Level 1 Commands", string, "OK", "");
return 1;
}
else if (playerData[playerid][playerLevel] >= 2)
{
new string[1400];
format(string, sizeof(string), "%s{98B0CD}LEVEL 2 COMMANDS{51FF00}\n/alog /explode /vrespawn /Duel /(un)mute\n/playerweapons /arenas /clearchat /blockask /blockreport\n\n", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL2, DIALOG_STYLE_MSGBOX, "Admin Level 2 Commands", string, "OK", "");
return 1;
}
else if (playerData[playerid][playerLevel] >= 3)
{
new string[1400];
format(string, sizeof(string), "%s{98B0CD}LEVEL 3 COMMANDS{51FF00}\n/ban /vc(create) /getpforevent /unfreezeall /setskin /vdestroy /get /vgoto /vbring /resetweapons\n/forcerules /forcecoptutorial \n/aheal /playertokens /playervehicles /playertokens \n/playerjailtime /playerjob\n\n", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL3, DIALOG_STYLE_MSGBOX, "Admin Level 2 Commands", string, "OK", "");
return 1;
}
else if (playerData[playerid][playerLevel] >= 7)
{
new string[1400];
format(string, sizeof(string), "%s{98B0CD}LEVEL 443 COMMANDS{51FF00}\n/ban /vc(create) /getpforevent /unfreezeall /setskin /vdestroy /get /vgoto /vbring /resetweapons\n/forcerules /forcecoptutorial \n/aheal /playertokens /playervehicles /playertokens \n/playerjailtime /playerjob\n\n", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL7, DIALOG_STYLE_MSGBOX, "Admin Level 7 Commands", string, "OK", "");
return 1;
}
return 1;
}
return 0;
}
COMMAND:acmds(playerid, params[]) { if(playerData[playerid][playerLoggedIn]) { if(playerData[playerid][playerLevel] == 1) { new string[1400]; format(string, sizeof(string), "%s{98B0CD}LEVEL 1 COMMANDS{51FF00}\n/goto /aod /kick /jail /asay /spawn /slap /warn\n/(un)freeze /playerstats /spec /specoff /rarb\n\n", string); ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL1, DIALOG_STYLE_MSGBOX, "Admin Level 1 Commands", string, "OK", ""); return 1; } else if (playerData[playerid][playerLevel] == 2) { new string[1400]; format(string, sizeof(string), "%s{98B0CD}LEVEL 2 COMMANDS{51FF00}\n/alog /explode /vrespawn /Duel /(un)mute\n/playerweapons /arenas /clearchat /blockask /blockreport\n\n", string); ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL2, DIALOG_STYLE_MSGBOX, "Admin Level 2 Commands", string, "OK", ""); return 1; } else if (playerData[playerid][playerLevel] == 3) { new string[1400]; format(string, sizeof(string), "%s{98B0CD}LEVEL 3 COMMANDS{51FF00}\n/ban /vc(create) /getpforevent /unfreezeall /setskin /vdestroy /get /vgoto /vbring /resetweapons\n/forcerules /forcecoptutorial \n/aheal /playertokens /playervehicles /playertokens \n/playerjailtime /playerjob\n\n", string); ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL3, DIALOG_STYLE_MSGBOX, "Admin Level 2 Commands", string, "OK", ""); return 1; } else if (playerData[playerid][playerLevel] == 7) { new string[1400]; format(string, sizeof(string), "%s{98B0CD}LEVEL 443 COMMANDS{51FF00}\n/ban /vc(create) /getpforevent /unfreezeall /setskin /vdestroy /get /vgoto /vbring /resetweapons\n/forcerules /forcecoptutorial \n/aheal /playertokens /playervehicles /playertokens \n/playerjailtime /playerjob\n\n", string); ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL7, DIALOG_STYLE_MSGBOX, "Admin Level 7 Commands", string, "OK", ""); return 1; } return 1; } return 0; }
I want my command to show only the admin level you are, Example: I'm level 7 admin and when I do /acmds It should only show me the dialog of Admin lvl 7 instead its showing me the first dialog which is admin lvl 1, How do I fix this?
|
switch(playerData[playerid][playerLevel]) { case 1: // show level 1 cmds break; case 2: // show level 2 cmds break; }
COMMAND:acmds(playerid, params[])
{
if(playerData[playerid][playerLoggedIn])
{
switch(playerData[playerid][playerLevel])
{
case 1:
new string[1400];
format(string, sizeof(string), "%s{98B0CD}LEVEL 1 COMMANDS{51FF00}\n/goto /aod /kick /jail /asay /spawn /slap /warn\n/(un)freeze /playerstats /spec /specoff /rarb\n\n", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL1, DIALOG_STYLE_MSGBOX, "Admin Level 1 Commands", string, "OK", "");
break;
case 2:
new string[1400];
format(string, sizeof(string), "%s{98B0CD}LEVEL 2 COMMANDS{51FF00}\n/alog /explode /vrespawn /Duel /(un)mute\n/playerweapons /arenas /clearchat /blockask /blockreport\n\n", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL2, DIALOG_STYLE_MSGBOX, "Admin Level 2 Commands", string, "OK", "");
break;
}
}
}
COMMAND:acmds(playerid, params[])
{
if(playerData[playerid][playerLoggedIn])
{
if(playerData[playerid][playerLevel] == 1)
{
new string[1400];
format(string, sizeof(string), "%s{98B0CD}LEVEL 1 COMMANDS{51FF00}\n/goto /aod /kick /jail /asay /spawn /slap /warn\n/(un)freeze /playerstats /spec /specoff /rarb\n\n", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL1, DIALOG_STYLE_MSGBOX, "Admin Level 1 Commands", string, "OK", "");
return 1;
}
else if (playerData[playerid][playerLevel] == 2)
{
new string[1400];
format(string, sizeof(string), "%s{98B0CD}LEVEL 2 COMMANDS{51FF00}\n/alog /explode /vrespawn /Duel /(un)mute\n/playerweapons /arenas /clearchat /blockask /blockreport\n\n", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL2, DIALOG_STYLE_MSGBOX, "Admin Level 2 Commands", string, "OK", "");
return 1;
}
else if (playerData[playerid][playerLevel] == 3)
{
new string[1400];
format(string, sizeof(string), "%s{98B0CD}LEVEL 3 COMMANDS{51FF00}\n/ban /vc(create) /getpforevent /unfreezeall /setskin /vdestroy /get /vgoto /vbring /resetweapons\n/forcerules /forcecoptutorial \n/aheal /playertokens /playervehicles /playertokens \n/playerjailtime /playerjob\n\n", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL3, DIALOG_STYLE_MSGBOX, "Admin Level 2 Commands", string, "OK", "");
return 1;
}
else if (playerData[playerid][playerLevel] == 4)
{
new string[1400];
format(string, sizeof(string), "%s{98B0CD}LEVEL 4 COMMANDS{51FF00}\n//unban /un)copban /gspy /resetskin <player id> /getip /countdown /respawnalluv /(un)armyban /destroyallav \n/announce /ffaevent /startffa /destroyffa/pmspy /dmevent /startdm /glassevent\n/startglass /destroyglass /falloutevent /startfallout /destroyfallout \n/cvrevent /startcvr /lmsevent /destroylms /adkill /uncuff\n\n", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL4, DIALOG_STYLE_MSGBOX, "Admin Level 4 Commands", string, "OK", "");
return 1;
}
else if (playerData[playerid][playerLevel] == 5)
{
new string[1400];
format(string, sizeof(string), "%s{98B0CD}LEVEL 5 COMMANDS{51FF00}\n/ahealall /cwspy /createhouse /deletehouse /giveweapon /respawnallv /resetallweapons \n/pingimmune /gotocase /startcase /houseinfo\n\n", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL5, DIALOG_STYLE_MSGBOX, "Admin Level 5 Commands", string, "OK", "");
return 1;
}
else if (playerData[playerid][playerLevel] == 6)
{
new string[1400];
format(string, sizeof(string), "%s{98B0CD}LEVEL 6 COMMANDS{51FF00}\n/teleport /giveallweapon /doublexp /motd /motd(1-3) /ping /fine \n/playerhouses /standardvip \n/silvervip /goldvip /givetoken /givecash \n/givexp /b\n\nTo view commands in lower level admin click Next", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL6, DIALOG_STYLE_MSGBOX, "Admin Level 6 Commands", string, "Okay", "");
return 1;
}
else if (playerData[playerid][playerLevel] == 7)
{
new string[1400];
format(string, sizeof(string), "%s{98B0CD}LEVEL 7 COMMANDS{51FF00}\nset\nTo view commands in lower level admin click Next", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL7, DIALOG_STYLE_MSGBOX, "Admin Level 7 Commands", string, "Okay", "Next");
return 1;
}
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new string[1400];
switch(dialogid)
{
case DIALOG_ADMIN_LEVEL7:
{
if(response == 1)
{
format(string, sizeof(string), "%s{98B0CD}LEVEL 6 COMMANDS{51FF00}\n/teleport /giveallweapon /doublexp /motd /motd(1-3) /ping /fine \n/playerhouses /standardvip \n/silvervip /goldvip /givetoken /givecash \n/givexp /b\n\nTo view commands in lower level admin click Next", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL6, DIALOG_STYLE_MSGBOX, "Admin Level 6 Commands", string, "Okay", "Next");
return 1;
}
}
case DIALOG_ADMIN_LEVEL6:
{
if(response == 1)
{
format(string, sizeof(string), "%s{98B0CD}LEVEL 5 COMMANDS{51FF00}\n/ahealall /cwspy /createhouse /deletehouse /giveweapon /respawnallv /resetallweapons \n/pingimmune /gotocase /startcase /houseinfo\n\n", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL5, DIALOG_STYLE_MSGBOX, "Admin Level 5 Commands", string, "Okay", "Next");
return 1;
}
}
case DIALOG_ADMIN_LEVEL5:
{
if(response == 1)
{
format(string, sizeof(string), "%s{98B0CD}LEVEL 4 COMMANDS{51FF00}\n//unban /un)copban /gspy /resetskin <player id> /getip /countdown /respawnalluv /(un)armyban /destroyallav \n/announce /ffaevent /startffa /destroyffa/pmspy /dmevent /startdm /glassevent\n/startglass /destroyglass /falloutevent /startfallout /destroyfallout \n/cvrevent /startcvr /lmsevent /destroylms /adkill /uncuff\n\n", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL4, DIALOG_STYLE_MSGBOX, "Admin Level 4 Commands", string, "Okay", "Next");
return 1;
}
}
case DIALOG_ADMIN_LEVEL4:
{
if(response == 1)
{
format(string, sizeof(string), "%s{98B0CD}LEVEL 3 COMMANDS{51FF00}\n/ban /vc(create) /getpforevent /unfreezeall /setskin /vdestroy /get /vgoto /vbring /resetweapons\n/forcerules /forcecoptutorial \n/aheal /playertokens /playervehicles /playertokens \n/playerjailtime /playerjob\n\n", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL3, DIALOG_STYLE_MSGBOX, "Admin Level 2 Commands", string, "Okay", "Next");
return 1;
}
}
case DIALOG_ADMIN_LEVEL3:
{
if(response == 1)
{
format(string, sizeof(string), "%s{98B0CD}LEVEL 2 COMMANDS{51FF00}\n/alog /explode /vrespawn /Duel /(un)mute\n/playerweapons /arenas /clearchat /blockask /blockreport\n\n", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL2, DIALOG_STYLE_MSGBOX, "Admin Level 2 Commands", string, "Okay", "Next");
return 1;
}
}
case DIALOG_ADMIN_LEVEL2:
{
if(response == 1)
{
format(string, sizeof(string), "%s{98B0CD}LEVEL 1 COMMANDS{51FF00}\n/goto /aod /kick /jail /asay /spawn /slap /warn\n/(un)freeze /playerstats /spec /specoff /rarb\n\n", string);
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL1, DIALOG_STYLE_MSGBOX, "Admin Level 1 Commands", string, "Okay", "Next");
return 1;
}
}
}
}