I have a speclist plugin, but the problem with it is that dead players and spectators can't see the message.
I want the list to be visible to everyone.
with the least possible load and the simplest solution.(This is very important) thanks in advance for the help!
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <fakemeta>
#if AMXX_VERSION_NUM < 183
#include <dhudmessage>
#endif
#if !defined MAX_PLAYERS
#define MAX_PLAYERS 32
#endif
#define IMMUNITY_FLAG ADMIN_BAN // Флаг с которым игрока не будет выводить в speclist, закомментируйте если хотите чтобы выводило всех.
#define UPDATE 1.0 // Частота обновлений списка
/*** Настройка цвета в RGB ***/
#define RED 0 // Количество красного
#define GREEN 255 // Количество зеленого
#define BLUE 0 // Количество синего
/*** Конец настройки цвета ***/
#pragma semicolon 1
new szDhud[MAX_PLAYERS][512];
public plugin_init() {
register_plugin("SpecList", "1.4", "pUzzlik"); // Remake Spectators List by FatalisDK
register_dictionary("speclist.txt");
set_task(UPDATE, "ShowSpecList", .flags="b");
}
public ShowSpecList() {
new szName[16], iLen[MAX_PLAYERS];
new iDead[MAX_PLAYERS], dCount;
get_players(iDead, dCount, "bch");
for(new i, id, spec; i < dCount; i++) {
id = iDead[i];
spec = pev(id, pev_iuser2);
if(spec == id) continue;
#if defined IMMUNITY_FLAG
if(get_user_flags(id) & IMMUNITY_FLAG) continue;
#endif
get_user_name(id, szName, charsmax(szName));
iLen[spec] += formatex(szDhud[spec][iLen[spec]], charsmax(szDhud[]) - iLen[spec], "%s^n", szName);
}
new iAlive[MAX_PLAYERS], aCount;
get_players(iAlive, aCount, "ach");
for(new i, id; i < aCount; i++) {
id = iAlive[i];
if(!szDhud[id][0]) continue;
set_dhudmessage(RED, GREEN, BLUE, 0.75, 0.15, 0, 0.0, UPDATE-0.01);
show_dhudmessage(id, "%L:^n%s", LANG_PLAYER, "SPECT", szDhud[id]);
arrayset(szDhud[id], 0, sizeof(szDhud[]));
}
}