|
Форум Программирование в Pawno Готовые команды /a по рангам (Админ чат по рангам) |
/a по рангам |
Ко всем forward
Код forward SendAdminMessage(color, string[];); Это в конец мода можно Код public SendAdminMessage(color, string[]) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo [i][pAdmin]>= 1) { SendClientMessage(i, color, string); } } } } Код if(strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "/a", true) == 0) { if(IsPlayerConnected(playerid)) { GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext [idx]<= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GREEN, "Вводите: (/a)dmin [чат]"); return 1; } new arank[64]; if(PlayerInfo [playerid][pAdmin]== 1) { arank = "{bef574}Помошник Модератора"; } else if(PlayerInfo [playerid][pAdmin]== 2) { arank = "{5da130}Мл.Модератор"; } else if(PlayerInfo [playerid][pAdmin]== 3) { arank = "{ff0033}Модератор"; } else if(PlayerInfo [playerid][pAdmin]== 4) { arank = "{ff0033}Гл.Модератор"; } else if(PlayerInfo [playerid][pAdmin]== 5) { arank = "{FFA500}Помошник Адм."; } else if(PlayerInfo [playerid][pAdmin]== 6) { arank = "{ff0033}Администратор"; } else if(PlayerInfo [playerid][pAdmin]== 7) { arank = "{ff0033}Рп Админ"; } else if(PlayerInfo [playerid][pAdmin]== 8) { arank = "{FFA500}Гл.Пиарщик"; } else if(PlayerInfo [playerid][pAdmin]== 9) { arank = "{ff0033}Вебмастер"; } else if(PlayerInfo [playerid][pAdmin]== 10) { arank = "{ff0033}Скриптёр"; } else if(PlayerInfo [playerid][pAdmin]== 11) { arank = "{ff0033}Зам.Гл Админа"; } else if(PlayerInfo [playerid][pAdmin]== 12) { arank = "{FFA500}Гл.Админ"; } else { arank = "Модератор"; } format(string, sizeof(string), "* %s {7fff00}%s %s", arank, sendername, result); if (PlayerInfo [playerid][pAdmin]>= 1) { SendAdminMessage(COLOR_RED, string); } //printf("Администратор %s: %s", sendername, result); } return 1; } Автор: Неизвестен Программист любитель :) |
| |||
| |||