Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <fakemeta>
- #pragma semicolon 1
- #define RED 64
- #define GREEN 64
- #define BLUE 64
- #define UPDATEINTERVAL 5.0
- new gMaxPlayers,gCvarImmunity,bool:gOnOff[33] = { true, ... };
- public plugin_init()
- {
- register_plugin("SpecList", "1.5", "FatalisDK+Seroff");
- gCvarImmunity = register_cvar("amx_speclist_immunity", "1", 0, 0.0);
- register_clcmd("say /speclist", "cmdSpecList", -1, "");
- gMaxPlayers = get_maxplayers();
- set_task(UPDATEINTERVAL, "tskShowSpec", 123094, "", 0, "b", 0);
- }
- public cmdSpecList(id)
- {
- if( gOnOff[id] )
- {
- client_print(id, print_chat, "[AMXX] Вы больше не будете видеть, кто в спекртах.");
- gOnOff[id] = false;
- }
- else
- {
- client_print(id, print_chat, "[AMXX] Теперь вы будете видеть кто в спектрах.");
- gOnOff[id] = true;
- }
- return 0;
- }
- public tskShowSpec()
- {
- static iCount,szFormat[10],szHud[1102],szName[34],bool:send;
- for( new alive = 1; alive <= gMaxPlayers; alive++ )
- {
- new bool:sendTo[33];
- send = false;
- if( !is_user_alive(alive) )
- {
- continue;
- }
- sendTo[alive] = true;
- get_user_name(alive, szName, 32);
- format(szHud, 65, "Наблюдают за %s (#num#):^n", szName);
- for( new dead = 1; dead <= gMaxPlayers; dead++ )
- {
- if( is_user_connected(dead) )
- {
- if( is_user_alive(dead) || is_user_bot(dead) )
- {
- continue;
- }
- if( pev(dead, pev_iuser2) == alive )
- {
- if( !(get_pcvar_num(gCvarImmunity)&&get_user_flags(dead, 0)&ADMIN_IMMUNITY) )
- {
- iCount++;
- get_user_name(dead, szName, 32);
- add(szName, 33, "^n", 0);
- add(szHud, 1101, szName, 0);
- send = true;
- }
- sendTo[dead] = true;
- }
- }
- }
- if( send == true )
- {
- formatex(szFormat,sizeof(szFormat)-1,"%d",iCount);
- replace(szHud, sizeof(szHud)-1, "#num#", szFormat);
- for( new i = 1; i <= gMaxPlayers; i++ )
- {
- if( sendTo[i] == true && gOnOff[i] == true )
- {
- set_hudmessage(RED, GREEN, BLUE,0.75, 0.15, 0, 0.0, UPDATEINTERVAL + 0.1, 0.0, 0.0, -1);
- show_hudmessage(i, szHud);
- }
- }
- }
- }
- iCount=0;
- return 0;
- }
- public client_connect(id) { gOnOff[id] = true; }
Add Comment
Please, Sign In to add comment