06.05.2013, 00:03
I have this long code but how do I make it shorter -_-
Код:
CMD:ah(playerid, params[]) return cmd_ahelp(playerid, params); CMD:ahelp(playerid, params[]) { if(PlayerInfo[playerid][pAdminLevel] == 1) { SendClientMessage(playerid, COLOR_YELLOW, "=============================="); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /slap, /gethere"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /slay"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /spec, /specoff"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /gotoplace, /goto"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /killcar"); SendClientMessage(playerid, COLOR_YELLOW, "=============================="); } if(PlayerInfo[playerid][pAdminLevel] == 2) { SendClientMessage(playerid, COLOR_YELLOW, "=============================="); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /slap, /gethere"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /slay"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /spec, /specoff"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /gotoplace, /goto"); SendClientMessage(playerid, COLOR_WHITE, "Level 2: /announce, /warn, /kick"); SendClientMessage(playerid, COLOR_YELLOW, "=============================="); } if(PlayerInfo[playerid][pAdminLevel] == 3) { SendClientMessage(playerid, COLOR_YELLOW, "=============================="); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /slap, /gethere"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /slay"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /spec, /specoff"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /gotoplace, /goto"); SendClientMessage(playerid, COLOR_WHITE, "Level 2: /announce, /warn, /kick"); SendClientMessage(playerid, COLOR_WHITE, "Level 3: /ban"); SendClientMessage(playerid, COLOR_YELLOW, "=============================="); return 1; } if(PlayerInfo[playerid][pAdminLevel] == 4) { SendClientMessage(playerid, COLOR_YELLOW, "=============================="); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /slap, /gethere"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /slay"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /spec, /specoff"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /gotoplace, /goto"); SendClientMessage(playerid, COLOR_WHITE, "Level 2: /announce, /warn, /kick"); SendClientMessage(playerid, COLOR_WHITE, "Level 3: /ban"); SendClientMessage(playerid, COLOR_WHITE, "Level 4: /givemoney, /givegun "); SendClientMessage(playerid, COLOR_WHITE, "Level 4: /sethp, /setarmour"); SendClientMessage(playerid, COLOR_WHITE, "Level 4: /setscore, /v"); SendClientMessage(playerid, COLOR_WHITE, "Level 4: /respawncars"); SendClientMessage(playerid, COLOR_YELLOW, "=============================="); return 1; } if(PlayerInfo[playerid][pAdminLevel] == 5) { SendClientMessage(playerid, COLOR_YELLOW, "=============================="); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /slap, /gethere"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /slay"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /spec, /specoff"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /gotoplace, /goto"); SendClientMessage(playerid, COLOR_WHITE, "Level 2: /announce, /warn, /kick"); SendClientMessage(playerid, COLOR_WHITE, "Level 3: /ban"); SendClientMessage(playerid, COLOR_WHITE, "Level 4: /givemoney, /givegun "); SendClientMessage(playerid, COLOR_WHITE, "Level 4: /sethp, /setarmour"); SendClientMessage(playerid, COLOR_WHITE, "Level 4: /setscore, /v"); SendClientMessage(playerid, COLOR_WHITE, "Level 5: /restartserver, /setadmin"); SendClientMessage(playerid, COLOR_YELLOW, "=============================="); return 1; } if(PlayerInfo[playerid][pAdminLevel] == 6) { SendClientMessage(playerid, COLOR_YELLOW, "=============================="); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /slap, /gethere"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /slay"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /spec, /specoff"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /gotoplace, /goto"); SendClientMessage(playerid, COLOR_WHITE, "Level 2: /announce, /warn, /kick"); SendClientMessage(playerid, COLOR_WHITE, "Level 3: /ban"); SendClientMessage(playerid, COLOR_WHITE, "Level 4: /givemoney, /givegun "); SendClientMessage(playerid, COLOR_WHITE, "Level 4: /sethp, /setarmour"); SendClientMessage(playerid, COLOR_WHITE, "Level 4: /setscore, /v"); SendClientMessage(playerid, COLOR_WHITE, "Level 5: /restartserver, /setadmin"); SendClientMessage(playerid, COLOR_YELLOW, "=============================="); } if(PlayerInfo[playerid][pAdminLevel] == 7) { SendClientMessage(playerid, COLOR_YELLOW, "=============================="); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /slap, /gethere"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /slay"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /spec, /specoff"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: /gotoplace, /goto"); SendClientMessage(playerid, COLOR_WHITE, "Level 2: /announce, /warn, /kick"); SendClientMessage(playerid, COLOR_WHITE, "Level 3: /ban"); SendClientMessage(playerid, COLOR_WHITE, "Level 4: /givemoney, /givegun "); SendClientMessage(playerid, COLOR_WHITE, "Level 4: /sethp, /setarmour"); SendClientMessage(playerid, COLOR_WHITE, "Level 4: /setscore, /v"); SendClientMessage(playerid, COLOR_WHITE, "Level 5: /restartserver, /setadmin"); SendClientMessage(playerid, COLOR_WHITE, "Level 7: /banofflineplayer"); SendClientMessage(playerid, COLOR_YELLOW, "=============================="); } return 1; }