Търся този плъгин (Speedometers / FPS / Showkeys)

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
tom1k
Извън линия
Потребител
Потребител
Мнения: 202
Регистриран на: 29 Сеп 2020, 23:50
Местоположение: Добрич
Се отблагодари: 16 пъти
Получена благодарност: 8 пъти

Търся този плъгин (Speedometers / FPS / Showkeys)

Мнение от tom1k » 02 Юни 2021, 15:28

На снимката се вижда:
Не е нужно баш да е този, просто да ги има същите неща (Speed,Fps,Keys)
Изображение
iG-Blockmaker # HNS 100aa
45.144.155.175:27018


Аватар
atmax
Извън линия
Потребител
Потребител
Мнения: 492
Регистриран на: 22 Мар 2018, 15:06
Се отблагодари: 37 пъти
Получена благодарност: 43 пъти

Търся този плъгин (Speedometers / FPS / Showkeys)

Мнение от atmax » 02 Юни 2021, 18:32

Spec Info - Money, HP, Ping, FPS, Armor:

Код за потвърждение: Избери целия код

/*

	Когато спектейтвате някого, горе в дясно има HUD, с информацията за наблюдавания.
	Информация като: Парите му, Кръвта му, Неговият Пинг, Неговото FPS, Армора му.
	Полезен за всякакъв вид сървъри. Най-удобен е за JUMP, където се вижда FPS на играча.

*/


#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <cstrike>

#pragma semicolon 1

#define RED 64
#define GREEN 64
#define BLUE 64
#define UPDATEINTERVAL 1.0

// Comment below if you do not want /speclist showing up on chat
#define ECHOCMD

// Admin flag used for immunity
#define FLAG ADMIN_IMMUNITY

new const PLUGIN[] = "SpecList";
new const VERSION[] = "1.2a";
new const AUTHOR[] = "SasaiLalka"; // ? едит ? ме ?

new gMaxPlayers;
new gCvarOn;
new gCvarImmunity;
new bool:gOnOff[33] = { true, ... };
new g_fps[33][11]; 
new g_i[33]; 

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_cvar(PLUGIN, VERSION, FCVAR_SERVER, 0.0);
	gCvarOn = register_cvar("amx_speclist", "1", 0, 0.0);
	gCvarImmunity = register_cvar("amx_speclist_immunity", "1", 0, 0.0);
	
	register_clcmd("speclist", "cmdSpecList", -1, "");
	
	gMaxPlayers = get_maxplayers();
	
	set_task(UPDATEINTERVAL, "tskShowSpec", 123094, "", 0, "b", 0);
}

public cmdSpecList(id)
{
	if( gOnOff[id] )
	{
		Color_Print(id, "!y[!gSpectator List!y] !yThe list is !tDisabled");
		gOnOff[id] = false;
	}
	else
	{
		Color_Print(id, "!y[!gSpectator List!y] !yThe list is !tEnabled");
		gOnOff[id] = true;
	}
	
	#if defined ECHOCMD
	return PLUGIN_CONTINUE;
	#else
	return PLUGIN_HANDLED;
	#endif
}

public tskShowSpec()
{
	if( !get_pcvar_num(gCvarOn) )
	{
		return PLUGIN_CONTINUE;
	}
	
	static szHud[1102];//32*33+45
	static szName[34];
	static bool:send;
	
	// FRUITLOOOOOOOOOOOOPS!
	for( new alive = 1; alive <= gMaxPlayers; alive++ )
	{
		new bool:sendTo[33];
		send = false;
		
		if( !is_user_alive(alive) )
		{
			continue;
		}
		new ping,loss;
		sendTo[alive] = true;
		get_user_ping(alive, ping, loss); 
		get_user_name(alive, szName, 32);
		format(szHud, 245, "Player: %s^nMoney: $%d | HP: %d^nPing: %i | FPS: %i | Armor: %d^n^nSpectators:^n", szName, cs_get_user_money(alive), get_user_health(alive), ping, get_user_fps(alive), get_user_armor(alive));
		
		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)&FLAG) )
					{
						get_user_name(dead, szName, 32);
						add(szName, 33, "^n", 0);
						add(szHud, 1101, szName, 0);
						send = true;
					}

					sendTo[dead] = true;
					
				}
			}
		}
		
		if( send == true )
		{
			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);
				}
			}
		}
	}
	
	return PLUGIN_CONTINUE;
}

public client_PreThink(id)
        g_fps[id][10]++; 

public client_putinserver(id) 
    set_task(0.1, "count", id, "", 0, "b"); 
        
public count(id) { 
 
    if ( g_i[id] < 9 )
        g_i[id]++; 
    else
        g_i[id] = 0; 
          
    g_fps[id][g_i[id]] = g_fps[id][10]; 
    g_fps[id][10] = 0; 
} 
 
get_user_fps(id)  
{ 
    new i; 
    new j = 0; 
      
    for ( i = 0; i < 9; i++ ) 
        j += g_fps[id][i]; 
      
    return j - 5; 
}

public client_connect(id)
{
	gOnOff[id] = true;
}

public client_disconnect(id)
{
	gOnOff[id] = true;
}

stock Color_Print(const id, const input[], any:...)
{
    new iCount = 1, iPlayers[32];

    static szMsg[191];
    vformat(szMsg, charsmax(szMsg), input, 3);

    replace_all(szMsg, 190, "!g", "^4");
    replace_all(szMsg, 190, "!y", "^1");
    replace_all(szMsg, 190, "!t", "^3");
    replace_all(szMsg, 190, "/w", "^0");

    if(id) iPlayers[0] = id;
    else get_players(iPlayers, iCount, "ch");

    for (new i = 0; i < iCount; i++)
    {
        if (is_user_connected(iPlayers[i]))
        {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, iPlayers[i]);
            write_byte(iPlayers[i]);
            write_string(szMsg);
            message_end();
        }
    }
}
Spec Info - FPS Show:

Код за потвърждение: Избери целия код

/*

	Разширеният Spec Info, с който можеш да наблюдаваш играча какви копчета натиска.
	Добавена е опция за показване на FPS-то на играча.
	Използва се най-вече за JUMP сървъри -> HNS, Deathrun, KZ и т.н..

*/


#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>

new const VERSION[ ] = "1.3.1"
new const TRKCVAR[ ] = "specinfo_version"
#define IMMUNE_FLAG ADMIN_IMMUNITY

#define KEYS_STR_LEN 31
#define LIST_STR_LEN 610
#define BOTH_STR_LEN KEYS_STR_LEN + LIST_STR_LEN

//cl_prefs constants
#define FL_LIST    ( 1 << 0 )
#define FL_KEYS    ( 1 << 1 )
#define FL_OWNKEYS ( 1 << 2 )
#define FL_HIDE    ( 1 << 3 )

//cvar pointers
new p_enabled, p_list_enabled, p_keys_enabled, p_list_default, p_keys_default;
new p_red, p_grn, p_blu, p_immunity;

//data arrays
new cl_keys[33], cl_prefs[33];
new keys_string[33][KEYS_STR_LEN + 1], list_string[33][LIST_STR_LEN + 1]
new cl_names[33][21], spec_ids[33][33];

new tFramesPer[ 33 ], tFps[ 33 ], Float:tGameTime[ 33 ], tCurFps[ 33 ];

public plugin_init( )
{
	register_plugin( "SpecInfo", VERSION, "Ian Cammarata" );
	register_cvar( TRKCVAR, VERSION, FCVAR_SERVER );
	set_cvar_string( TRKCVAR, VERSION );
	
	register_forward( FM_PlayerPreThink, "fwPlayerPreThink" );
	
	p_enabled = register_cvar( "si_enabled", "1" );
	p_list_enabled = register_cvar( "si_list_enabled", "0" );
	p_keys_enabled = register_cvar( "si_keys_enabled", "1" );
	p_list_default = register_cvar( "si_list_default", "0" );
	p_keys_default = register_cvar( "si_keys_default", "1" );
	p_immunity = register_cvar( "si_immunity", "1" );
	p_red = register_cvar( "si_msg_r", "3" );
	p_grn = register_cvar( "si_msg_g", "147" );
	p_blu = register_cvar( "si_msg_b", "230" );
	
	register_clcmd( "say /speclist", "toggle_list", _, "Toggle spectator list." );
	register_clcmd( "say /speckeys", "toggle_keys", _, "Toggle spectator keys." );
	register_clcmd( "say /showkeys", "toggle_ownkeys", _, "Toggle viewing own keys." );
	register_clcmd( "say /spechide", "toggle_hide", IMMUNE_FLAG, "Admins toggle being hidden from list." );
	
	set_task( 1.0, "list_update", _, _, _, "b" );
	set_task( 0.1, "keys_update", _, _, _, "b" );
	
	register_dictionary( "specinfo.txt" );
}

public fwPlayerPreThink( id )
{
	if( is_user_connected( id ) )
	{
		tGameTime[ id ] = get_gametime( );
		if( tFramesPer[ id ] > tGameTime[ id ] )
		{
			tFps[ id ] += 1;
		}
		else
		{
			tFramesPer[ id ] += 1;
			tCurFps[ id ] = tFps[ id ];
			tFps[ id ] = 0;
		}
	}
}

public client_connect( id )
{
	cl_prefs[id] = 0;
	if( !is_user_bot( id ) )
	{
		if( get_pcvar_num( p_list_default ) ) cl_prefs[id] |= FL_LIST;
		if( get_pcvar_num( p_keys_default ) ) cl_prefs[id] |= FL_KEYS;
	}
	get_user_name( id, cl_names[id], 20 );
	toggle_ownkeys(id)
	return PLUGIN_CONTINUE;
}

public client_infochanged( id )
{
	get_user_name( id, cl_names[id], 20 );
	return PLUGIN_CONTINUE;
}

public list_update( )
{
	if( get_pcvar_num( p_enabled ) && get_pcvar_num ( p_list_enabled ) )
  {
		new players[32], num, id, id2, i, j;
		for( i = 1; i < 33; i++ ) spec_ids[i][0] = 0;
		
		get_players( players, num, "bch" );
		for( i = 0; i < num; i++ )
    {
			id = players[i];
			if( !( get_user_flags( id ) & IMMUNE_FLAG && get_pcvar_num( p_immunity ) && cl_prefs[id] & FL_HIDE ) )
			{
				id2 = pev( id, pev_iuser2 );
				if( id2 )
				{
					spec_ids[ id2 ][ 0 ]++;
					spec_ids[ id2 ][ spec_ids[ id2 ][ 0 ] ] = id;
				}
			}
		}
		new tmplist[ LIST_STR_LEN + 1 ], tmpstr[41];
		new count, namelen, tmpname[21];
		for( i=1; i<33; i++ )
    {
			count = spec_ids[i][0];
			if( count )
			{
				namelen = ( LIST_STR_LEN - 10 ) / count;
				clamp( namelen, 10, 20 );
				format( tmpname, namelen, cl_names[i] );
				formatex( tmplist, LIST_STR_LEN - 1, "^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t(%d) %s %s:^n", count, "%L", tmpname);
				for( j=1; j<=count; j++ )
        {
					format( tmpname, namelen, cl_names[spec_ids[i][j]]);
					formatex( tmpstr, 40, "^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t%s", tmpname );
					if( strlen( tmplist ) + strlen( tmpstr ) + ( 11 - j ) < ( LIST_STR_LEN - 1 ) )
						format( tmplist, LIST_STR_LEN - 10, "%s%s^n", tmplist, tmpstr );
					else
          {
						format( tmplist, LIST_STR_LEN, "%s...^n", tmplist );
						break;
					}
				}
				if( count < 10 )
          format( tmplist, LIST_STR_LEN,
						"%s^n^n^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^n",
						tmplist, VERSION
					);
				for( j+=0; j<10; j++ )
          format( tmplist, LIST_STR_LEN, "%s%s", tmplist, "^n" );
				list_string[i] = tmplist;
			}
		}
		get_players( players, num, "ch" );
		for( i=0; i<num; i++ ) clmsg( players[i] );
	}
	return PLUGIN_HANDLED;
}

public keys_update( )
{
	if( !get_pcvar_num( p_enabled ) && !get_pcvar_num( p_keys_enabled ) ) return;

	new players[32], num, id, i, Float:fVelocity[3], Float:fSpeed;
	get_players( players, num, "a" );
	for( i = 0; i < num; i++ )
  {
		id = players[i];
		pev(id, pev_velocity, fVelocity)
        fSpeed = vector_length(fVelocity)
		formatex( keys_string[id], KEYS_STR_LEN, " ^n^n^t^t%s^t^t^t%s^n^t%s %s %s^t%s^nFPS: %d^nSpeed:%.2f units/sec",
			cl_keys[id] & IN_FORWARD ? "W" : " .",
			"%L",
			cl_keys[id] & IN_MOVELEFT ? "A" : ".",
			cl_keys[id] & IN_BACK ? "S" : ".",
			cl_keys[id] & IN_MOVERIGHT ? "D" : ".",
			"%L"
		, tCurFps[ id ], fSpeed);
		
		//Flags stored in string to fill translation char in clmsg function
		keys_string[id][0] = 0; 
		if( cl_keys[id] & IN_JUMP ) keys_string[id][0] |= IN_JUMP;
		if( cl_keys[id] & IN_DUCK ) keys_string[id][0] |= IN_DUCK;
		
		cl_keys[id] = 0;
	}
	
	new id2;
	get_players( players, num, "ch" );
	for( i=0; i<num; i++ )
  {
		id = players[i];
		if( is_user_alive( id ) )
		{
			if( cl_prefs[id] & FL_OWNKEYS ) clmsg( id );
		}
		else
		{
			id2 = pev( id, pev_iuser2 );
			if( cl_prefs[id] & FL_KEYS && id2 && id2 != id ) clmsg( id );
		}
	}

}

public server_frame( )
{
	if( get_pcvar_num( p_enabled ) && get_pcvar_num( p_keys_enabled ) )
  {
		new players[32], num, id;
		get_players( players, num, "a" );
		for( new i = 0; i < num; i++ )
		{
			id = players[i];
			if( get_user_button( id ) & IN_FORWARD )
				cl_keys[id] |= IN_FORWARD;
			if( get_user_button( id ) & IN_BACK )
				cl_keys[id] |= IN_BACK;
			if( get_user_button( id ) & IN_MOVELEFT )
				cl_keys[id] |= IN_MOVELEFT;
			if( get_user_button( id ) & IN_MOVERIGHT )
				cl_keys[id] |= IN_MOVERIGHT;
			if( get_user_button( id ) & IN_DUCK )
				cl_keys[id] |= IN_DUCK;
			if( get_user_button( id ) & IN_JUMP )
				cl_keys[id] |= IN_JUMP;
		}
	}
	return PLUGIN_CONTINUE
}

public clmsg( id )
{
	if( !id ) return;
	
	new prefs = cl_prefs[id];
	
	new bool:show_own = false;
	if( is_user_alive( id ) && prefs & FL_OWNKEYS ) show_own = true;
	
	if( is_user_alive( id ) && !show_own )
  {
		if( prefs & FL_LIST && spec_ids[id][0] && get_pcvar_num( p_list_enabled ) )
		{
			set_hudmessage(
        get_pcvar_num( p_red ),
        get_pcvar_num( p_grn ),
        get_pcvar_num( p_blu ),
        0.7, /*x*/
        0.1, /*y*/
        0, /*fx*/
        0.0, /*fx time*/
        1.1, /*hold time*/
        0.1, /*fade in*/
        0.1, /*fade out*/
        4 /*chan - 3*/ 
			);
			show_hudmessage( id, list_string[id], id, "SPECTATING" );
		}
	}
	else
  {
		new id2;
		if( show_own ) id2 = id;
		else id2 = pev( id, pev_iuser2 );
		if( !id2 ) return;
		
		if( prefs & FL_LIST || prefs & FL_KEYS || show_own )
    {
			set_hudmessage(
        get_pcvar_num( p_red ),
        get_pcvar_num( p_grn ),
        get_pcvar_num( p_blu ),
        0.48, /*x*/
        0.14, /*y*/
        0, /*fx*/
        0.0, /*fx time*/
        prefs & FL_KEYS || show_own ? 0.1 : 1.1, /*hold time*/
        0.1, /*fade in*/
        0.1, /*fade out*/
        4 /*chan - 3*/
			);
			new msg[BOTH_STR_LEN + 1];
			if( prefs & FL_LIST && get_pcvar_num( p_list_enabled ) && spec_ids[id2][0] )
        formatex(msg,BOTH_STR_LEN,list_string[id2],id,"SPECTATING");
			else msg ="^n^n^n^n^n^n^n^n^n^n^n^n";
			if( get_pcvar_num( p_keys_enabled ) && ( prefs & FL_KEYS || show_own ) )
      {
        format( msg, BOTH_STR_LEN, "%s%s", msg, keys_string[id2][1] );
        format( msg, BOTH_STR_LEN, msg,
					id, keys_string[id2][0] & IN_JUMP ? "JUMP" : "LAME",
					id, keys_string[id2][0] & IN_DUCK ? "DUCK" : "LAME"
				);
      }
			show_hudmessage( id, msg );
		}
	}
}

public set_hudmsg_flg_notify( )
{
	set_hudmessage(
		get_pcvar_num( p_red ),
		get_pcvar_num( p_grn ),
		get_pcvar_num( p_blu ),
		-1.0, /*x*/
		0.8, /*y*/
		0, /*fx*/
		0.0, /*fx time*/
		3.0, /*hold time*/
		0.0, /*fade in*/
		0.0, /*fade out*/
		4 /*chan - (-1)*/
	);
}

public toggle_list( id )
{
	set_hudmsg_flg_notify( );
	cl_prefs[id] ^= FL_LIST;
	show_hudmessage( id, "%L", id, cl_prefs[id] & FL_LIST ? "SPEC_LIST_ENABLED" : "SPEC_LIST_DISABLED" );
	return PLUGIN_HANDLED;
}

public toggle_keys( id )
{
	set_hudmsg_flg_notify( );
	cl_prefs[id] ^= FL_KEYS;
	show_hudmessage( id, "%L", id, cl_prefs[id] & FL_KEYS ? "SPEC_KEYS_ENABLED" : "SPEC_KEYS_DISABLED" );
	return PLUGIN_HANDLED;
}

public toggle_ownkeys( id )
{
	set_hudmsg_flg_notify( );
	cl_prefs[id] ^= FL_OWNKEYS;
	show_hudmessage( id, "%L", id, cl_prefs[id] & FL_OWNKEYS ? "SPEC_OWNKEYS_ENABLED" : "SPEC_OWNKEYS_DISABLED" );
	return PLUGIN_HANDLED;
}

public toggle_hide( id, level, cid )
{
	if( cmd_access( id, level, cid, 0 ) )
	{
		set_hudmsg_flg_notify( );
		cl_prefs[id] ^= FL_HIDE;
		show_hudmessage( id, "%L", id, cl_prefs[id] & FL_HIDE ? "SPEC_HIDE_ENABLED" : "SPEC_HIDE_DISABLED" );
	}
	return PLUGIN_HANDLED;
}
*Edit: Забравих за speed-a опитах се да ти го добавя във втория плъгин но от телефона малко трудно с този автокоректор.. :Д
Тествай пак втория!
Последно промяна от atmax на 02 Юни 2021, 20:40, променено общо 4 пъти.
Rest in peace my friend I always will remember you! 🖤👊

Аватар
tom1k
Извън линия
Потребител
Потребител
Мнения: 202
Регистриран на: 29 Сеп 2020, 23:50
Местоположение: Добрич
Се отблагодари: 16 пъти
Получена благодарност: 8 пъти

Търся този плъгин (Speedometers / FPS / Showkeys)

Мнение от tom1k » 02 Юни 2021, 19:01

atmax написа: 02 Юни 2021, 18:32 Spec Info - Money, HP, Ping, FPS, Armor:

Код за потвърждение: Избери целия код

/*

	Когато спектейтвате някого, горе в дясно има HUD, с информацията за наблюдавания.
	Информация като: Парите му, Кръвта му, Неговият Пинг, Неговото FPS, Армора му.
	Полезен за всякакъв вид сървъри. Най-удобен е за JUMP, където се вижда FPS на играча.

*/


#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <cstrike>

#pragma semicolon 1

#define RED 64
#define GREEN 64
#define BLUE 64
#define UPDATEINTERVAL 1.0

// Comment below if you do not want /speclist showing up on chat
#define ECHOCMD

// Admin flag used for immunity
#define FLAG ADMIN_IMMUNITY

new const PLUGIN[] = "SpecList";
new const VERSION[] = "1.2a";
new const AUTHOR[] = "SasaiLalka"; // ? едит ? ме ?

new gMaxPlayers;
new gCvarOn;
new gCvarImmunity;
new bool:gOnOff[33] = { true, ... };
new g_fps[33][11]; 
new g_i[33]; 

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_cvar(PLUGIN, VERSION, FCVAR_SERVER, 0.0);
	gCvarOn = register_cvar("amx_speclist", "1", 0, 0.0);
	gCvarImmunity = register_cvar("amx_speclist_immunity", "1", 0, 0.0);
	
	register_clcmd("speclist", "cmdSpecList", -1, "");
	
	gMaxPlayers = get_maxplayers();
	
	set_task(UPDATEINTERVAL, "tskShowSpec", 123094, "", 0, "b", 0);
}

public cmdSpecList(id)
{
	if( gOnOff[id] )
	{
		Color_Print(id, "!y[!gSpectator List!y] !yThe list is !tDisabled");
		gOnOff[id] = false;
	}
	else
	{
		Color_Print(id, "!y[!gSpectator List!y] !yThe list is !tEnabled");
		gOnOff[id] = true;
	}
	
	#if defined ECHOCMD
	return PLUGIN_CONTINUE;
	#else
	return PLUGIN_HANDLED;
	#endif
}

public tskShowSpec()
{
	if( !get_pcvar_num(gCvarOn) )
	{
		return PLUGIN_CONTINUE;
	}
	
	static szHud[1102];//32*33+45
	static szName[34];
	static bool:send;
	
	// FRUITLOOOOOOOOOOOOPS!
	for( new alive = 1; alive <= gMaxPlayers; alive++ )
	{
		new bool:sendTo[33];
		send = false;
		
		if( !is_user_alive(alive) )
		{
			continue;
		}
		new ping,loss;
		sendTo[alive] = true;
		get_user_ping(alive, ping, loss); 
		get_user_name(alive, szName, 32);
		format(szHud, 245, "Player: %s^nMoney: $%d | HP: %d^nPing: %i | FPS: %i | Armor: %d^n^nSpectators:^n", szName, cs_get_user_money(alive), get_user_health(alive), ping, get_user_fps(alive), get_user_armor(alive));
		
		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)&FLAG) )
					{
						get_user_name(dead, szName, 32);
						add(szName, 33, "^n", 0);
						add(szHud, 1101, szName, 0);
						send = true;
					}

					sendTo[dead] = true;
					
				}
			}
		}
		
		if( send == true )
		{
			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);
				}
			}
		}
	}
	
	return PLUGIN_CONTINUE;
}

public client_PreThink(id)
        g_fps[id][10]++; 

public client_putinserver(id) 
    set_task(0.1, "count", id, "", 0, "b"); 
        
public count(id) { 
 
    if ( g_i[id] < 9 )
        g_i[id]++; 
    else
        g_i[id] = 0; 
          
    g_fps[id][g_i[id]] = g_fps[id][10]; 
    g_fps[id][10] = 0; 
} 
 
get_user_fps(id)  
{ 
    new i; 
    new j = 0; 
      
    for ( i = 0; i < 9; i++ ) 
        j += g_fps[id][i]; 
      
    return j - 5; 
}

public client_connect(id)
{
	gOnOff[id] = true;
}

public client_disconnect(id)
{
	gOnOff[id] = true;
}

stock Color_Print(const id, const input[], any:...)
{
    new iCount = 1, iPlayers[32];

    static szMsg[191];
    vformat(szMsg, charsmax(szMsg), input, 3);

    replace_all(szMsg, 190, "!g", "^4");
    replace_all(szMsg, 190, "!y", "^1");
    replace_all(szMsg, 190, "!t", "^3");
    replace_all(szMsg, 190, "/w", "^0");

    if(id) iPlayers[0] = id;
    else get_players(iPlayers, iCount, "ch");

    for (new i = 0; i < iCount; i++)
    {
        if (is_user_connected(iPlayers[i]))
        {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, iPlayers[i]);
            write_byte(iPlayers[i]);
            write_string(szMsg);
            message_end();
        }
    }
}
Spec Info - FPS Show:

Код за потвърждение: Избери целия код

/*

	Разширеният Spec Info, с който можеш да наблюдаваш играча какви копчета натиска.
	Добавена е опция за показване на FPS-то на играча.
	Използва се най-вече за JUMP сървъри -> HNS, Deathrun, KZ и т.н..

*/


#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>

new const VERSION[ ] = "1.3.1"
new const TRKCVAR[ ] = "specinfo_version"
#define IMMUNE_FLAG ADMIN_IMMUNITY

#define KEYS_STR_LEN 31
#define LIST_STR_LEN 610
#define BOTH_STR_LEN KEYS_STR_LEN + LIST_STR_LEN

//cl_prefs constants
#define FL_LIST    ( 1 << 0 )
#define FL_KEYS    ( 1 << 1 )
#define FL_OWNKEYS ( 1 << 2 )
#define FL_HIDE    ( 1 << 3 )

//cvar pointers
new p_enabled, p_list_enabled, p_keys_enabled, p_list_default, p_keys_default;
new p_red, p_grn, p_blu, p_immunity;

//data arrays
new cl_keys[33], cl_prefs[33];
new keys_string[33][KEYS_STR_LEN + 1], list_string[33][LIST_STR_LEN + 1]
new cl_names[33][21], spec_ids[33][33];

new tFramesPer[ 33 ], tFps[ 33 ], Float:tGameTime[ 33 ], tCurFps[ 33 ];

public plugin_init( )
{
	register_plugin( "SpecInfo", VERSION, "Ian Cammarata" );
	register_cvar( TRKCVAR, VERSION, FCVAR_SERVER );
	set_cvar_string( TRKCVAR, VERSION );
	
	register_forward( FM_PlayerPreThink, "fwPlayerPreThink" );
	
	p_enabled = register_cvar( "si_enabled", "1" );
	p_list_enabled = register_cvar( "si_list_enabled", "0" );
	p_keys_enabled = register_cvar( "si_keys_enabled", "1" );
	p_list_default = register_cvar( "si_list_default", "0" );
	p_keys_default = register_cvar( "si_keys_default", "1" );
	p_immunity = register_cvar( "si_immunity", "1" );
	p_red = register_cvar( "si_msg_r", "3" );
	p_grn = register_cvar( "si_msg_g", "147" );
	p_blu = register_cvar( "si_msg_b", "230" );
	
	register_clcmd( "say /speclist", "toggle_list", _, "Toggle spectator list." );
	register_clcmd( "say /speckeys", "toggle_keys", _, "Toggle spectator keys." );
	register_clcmd( "say /showkeys", "toggle_ownkeys", _, "Toggle viewing own keys." );
	register_clcmd( "say /spechide", "toggle_hide", IMMUNE_FLAG, "Admins toggle being hidden from list." );
	
	set_task( 1.0, "list_update", _, _, _, "b" );
	set_task( 0.1, "keys_update", _, _, _, "b" );
	
	register_dictionary( "specinfo.txt" );
}

public fwPlayerPreThink( id )
{
	if( is_user_connected( id ) )
	{
		tGameTime[ id ] = get_gametime( );
		if( tFramesPer[ id ] > tGameTime[ id ] )
		{
			tFps[ id ] += 1;
		}
		else
		{
			tFramesPer[ id ] += 1;
			tCurFps[ id ] = tFps[ id ];
			tFps[ id ] = 0;
		}
	}
}

public client_connect( id )
{
	cl_prefs[id] = 0;
	if( !is_user_bot( id ) )
	{
		if( get_pcvar_num( p_list_default ) ) cl_prefs[id] |= FL_LIST;
		if( get_pcvar_num( p_keys_default ) ) cl_prefs[id] |= FL_KEYS;
	}
	get_user_name( id, cl_names[id], 20 );
	return PLUGIN_CONTINUE;
}

public client_infochanged( id )
{
	get_user_name( id, cl_names[id], 20 );
	return PLUGIN_CONTINUE;
}

public list_update( )
{
	if( get_pcvar_num( p_enabled ) && get_pcvar_num ( p_list_enabled ) )
  {
		new players[32], num, id, id2, i, j;
		for( i = 1; i < 33; i++ ) spec_ids[i][0] = 0;
		
		get_players( players, num, "bch" );
		for( i = 0; i < num; i++ )
    {
			id = players[i];
			if( !( get_user_flags( id ) & IMMUNE_FLAG && get_pcvar_num( p_immunity ) && cl_prefs[id] & FL_HIDE ) )
			{
				id2 = pev( id, pev_iuser2 );
				if( id2 )
				{
					spec_ids[ id2 ][ 0 ]++;
					spec_ids[ id2 ][ spec_ids[ id2 ][ 0 ] ] = id;
				}
			}
		}
		new tmplist[ LIST_STR_LEN + 1 ], tmpstr[41];
		new count, namelen, tmpname[21];
		for( i=1; i<33; i++ )
    {
			count = spec_ids[i][0];
			if( count )
			{
				namelen = ( LIST_STR_LEN - 10 ) / count;
				clamp( namelen, 10, 20 );
				format( tmpname, namelen, cl_names[i] );
				formatex( tmplist, LIST_STR_LEN - 1, "^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t(%d) %s %s:^n", count, "%L", tmpname);
				for( j=1; j<=count; j++ )
        {
					format( tmpname, namelen, cl_names[spec_ids[i][j]]);
					formatex( tmpstr, 40, "^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t%s", tmpname );
					if( strlen( tmplist ) + strlen( tmpstr ) + ( 11 - j ) < ( LIST_STR_LEN - 1 ) )
						format( tmplist, LIST_STR_LEN - 10, "%s%s^n", tmplist, tmpstr );
					else
          {
						format( tmplist, LIST_STR_LEN, "%s...^n", tmplist );
						break;
					}
				}
				if( count < 10 )
          format( tmplist, LIST_STR_LEN,
						"%s^n^n^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^n",
						tmplist, VERSION
					);
				for( j+=0; j<10; j++ )
          format( tmplist, LIST_STR_LEN, "%s%s", tmplist, "^n" );
				list_string[i] = tmplist;
			}
		}
		get_players( players, num, "ch" );
		for( i=0; i<num; i++ ) clmsg( players[i] );
	}
	return PLUGIN_HANDLED;
}

public keys_update( )
{
	if( !get_pcvar_num( p_enabled ) && !get_pcvar_num( p_keys_enabled ) ) return;

	new players[32], num, id, i;
	get_players( players, num, "a" );
	for( i = 0; i < num; i++ )
  {
		id = players[i];
		formatex( keys_string[id], KEYS_STR_LEN, " ^n^n^t^t%s^t^t^t%s^n^t%s %s %s^t%s^nFPS: %d",
			cl_keys[id] & IN_FORWARD ? "W" : " .",
			"%L",
			cl_keys[id] & IN_MOVELEFT ? "A" : ".",
			cl_keys[id] & IN_BACK ? "S" : ".",
			cl_keys[id] & IN_MOVERIGHT ? "D" : ".",
			"%L"
		, tCurFps[ id ]);
		
		//Flags stored in string to fill translation char in clmsg function
		keys_string[id][0] = 0; 
		if( cl_keys[id] & IN_JUMP ) keys_string[id][0] |= IN_JUMP;
		if( cl_keys[id] & IN_DUCK ) keys_string[id][0] |= IN_DUCK;
		
		cl_keys[id] = 0;
	}
	
	new id2;
	get_players( players, num, "ch" );
	for( i=0; i<num; i++ )
  {
		id = players[i];
		if( is_user_alive( id ) )
		{
			if( cl_prefs[id] & FL_OWNKEYS ) clmsg( id );
		}
		else
		{
			id2 = pev( id, pev_iuser2 );
			if( cl_prefs[id] & FL_KEYS && id2 && id2 != id ) clmsg( id );
		}
	}

}

public server_frame( )
{
	if( get_pcvar_num( p_enabled ) && get_pcvar_num( p_keys_enabled ) )
  {
		new players[32], num, id;
		get_players( players, num, "a" );
		for( new i = 0; i < num; i++ )
		{
			id = players[i];
			if( get_user_button( id ) & IN_FORWARD )
				cl_keys[id] |= IN_FORWARD;
			if( get_user_button( id ) & IN_BACK )
				cl_keys[id] |= IN_BACK;
			if( get_user_button( id ) & IN_MOVELEFT )
				cl_keys[id] |= IN_MOVELEFT;
			if( get_user_button( id ) & IN_MOVERIGHT )
				cl_keys[id] |= IN_MOVERIGHT;
			if( get_user_button( id ) & IN_DUCK )
				cl_keys[id] |= IN_DUCK;
			if( get_user_button( id ) & IN_JUMP )
				cl_keys[id] |= IN_JUMP;
		}
	}
	return PLUGIN_CONTINUE
}

public clmsg( id )
{
	if( !id ) return;
	
	new prefs = cl_prefs[id];
	
	new bool:show_own = false;
	if( is_user_alive( id ) && prefs & FL_OWNKEYS ) show_own = true;
	
	if( is_user_alive( id ) && !show_own )
  {
		if( prefs & FL_LIST && spec_ids[id][0] && get_pcvar_num( p_list_enabled ) )
		{
			set_hudmessage(
        get_pcvar_num( p_red ),
        get_pcvar_num( p_grn ),
        get_pcvar_num( p_blu ),
        0.7, /*x*/
        0.1, /*y*/
        0, /*fx*/
        0.0, /*fx time*/
        1.1, /*hold time*/
        0.1, /*fade in*/
        0.1, /*fade out*/
        4 /*chan - 3*/ 
			);
			show_hudmessage( id, list_string[id], id, "SPECTATING" );
		}
	}
	else
  {
		new id2;
		if( show_own ) id2 = id;
		else id2 = pev( id, pev_iuser2 );
		if( !id2 ) return;
		
		if( prefs & FL_LIST || prefs & FL_KEYS || show_own )
    {
			set_hudmessage(
        get_pcvar_num( p_red ),
        get_pcvar_num( p_grn ),
        get_pcvar_num( p_blu ),
        0.48, /*x*/
        0.14, /*y*/
        0, /*fx*/
        0.0, /*fx time*/
        prefs & FL_KEYS || show_own ? 0.1 : 1.1, /*hold time*/
        0.1, /*fade in*/
        0.1, /*fade out*/
        4 /*chan - 3*/
			);
			new msg[BOTH_STR_LEN + 1];
			if( prefs & FL_LIST && get_pcvar_num( p_list_enabled ) && spec_ids[id2][0] )
        formatex(msg,BOTH_STR_LEN,list_string[id2],id,"SPECTATING");
			else msg ="^n^n^n^n^n^n^n^n^n^n^n^n";
			if( get_pcvar_num( p_keys_enabled ) && ( prefs & FL_KEYS || show_own ) )
      {
        format( msg, BOTH_STR_LEN, "%s%s", msg, keys_string[id2][1] );
        format( msg, BOTH_STR_LEN, msg,
					id, keys_string[id2][0] & IN_JUMP ? "JUMP" : "LAME",
					id, keys_string[id2][0] & IN_DUCK ? "DUCK" : "LAME"
				);
      }
			show_hudmessage( id, msg );
		}
	}
}

public set_hudmsg_flg_notify( )
{
	set_hudmessage(
		get_pcvar_num( p_red ),
		get_pcvar_num( p_grn ),
		get_pcvar_num( p_blu ),
		-1.0, /*x*/
		0.8, /*y*/
		0, /*fx*/
		0.0, /*fx time*/
		3.0, /*hold time*/
		0.0, /*fade in*/
		0.0, /*fade out*/
		4 /*chan - (-1)*/
	);
}

public toggle_list( id )
{
	set_hudmsg_flg_notify( );
	cl_prefs[id] ^= FL_LIST;
	show_hudmessage( id, "%L", id, cl_prefs[id] & FL_LIST ? "SPEC_LIST_ENABLED" : "SPEC_LIST_DISABLED" );
	return PLUGIN_HANDLED;
}

public toggle_keys( id )
{
	set_hudmsg_flg_notify( );
	cl_prefs[id] ^= FL_KEYS;
	show_hudmessage( id, "%L", id, cl_prefs[id] & FL_KEYS ? "SPEC_KEYS_ENABLED" : "SPEC_KEYS_DISABLED" );
	return PLUGIN_HANDLED;
}

public toggle_ownkeys( id )
{
	set_hudmsg_flg_notify( );
	cl_prefs[id] ^= FL_OWNKEYS;
	show_hudmessage( id, "%L", id, cl_prefs[id] & FL_OWNKEYS ? "SPEC_OWNKEYS_ENABLED" : "SPEC_OWNKEYS_DISABLED" );
	return PLUGIN_HANDLED;
}

public toggle_hide( id, level, cid )
{
	if( cmd_access( id, level, cid, 0 ) )
	{
		set_hudmsg_flg_notify( );
		cl_prefs[id] ^= FL_HIDE;
		show_hudmessage( id, "%L", id, cl_prefs[id] & FL_HIDE ? "SPEC_HIDE_ENABLED" : "SPEC_HIDE_DISABLED" );
	}
	return PLUGIN_HANDLED;
}

Ако може на 2-рия да се добави и Speed ще ми свърши работа.
iG-Blockmaker # HNS 100aa
45.144.155.175:27018


Аватар
Midnight1337
Извън линия
Foreigner
Foreigner
Мнения: 72
Регистриран на: 15 Яну 2019, 00:53
Местоположение: Macedonia
Се отблагодари: 5 пъти
Получена благодарност: 21 пъти
Обратна връзка:

I'm looking for this plugin (Speedometers/FPS/Showkeys)

Мнение от Midnight1337 » 03 Юни 2021, 03:05

Speed meter and Player fps

Код за потвърждение: Избери целия код

#pragma semicolon 1

#include <amxmodx>
#include <fakemeta>
#include <reapi>

new g_ShowHudSync;
new g_iUserFPS[MAX_PLAYERS + 1];

public plugin_init() {
	register_plugin("[ReAPI] Speedometer & FPS", "0.0.3", "mIDnight");

	new ent = rg_create_entity("info_target");
	set_entvar(ent, var_nextthink, get_gametime() + 1.01);
	SetThink(ent, "@ent_think");
	register_forward(FM_CmdStart, "@fw_CmdStart");

	g_ShowHudSync = CreateHudSyncObj();
}

@ent_think(const ent) {
	static Float:velocity[3], Float:speed;

	for(new id = 1; id <= MaxClients; id++) {
		if(is_user_connected(id)) {
			id = get_entvar(id, var_iuser1) == 4 ? get_entvar(id, var_iuser2) : id;

			get_entvar(id, var_velocity, velocity);

			speed = vector_length(velocity);

			set_hudmessage(0, 50, 255, -1.0, 0.75, 0, 0.0, 0.1, 0.01, 0.0);
			ShowSyncHudMsg(id, g_ShowHudSync, "speed: %3.2f^n[ FPS: %d ]", speed, g_iUserFPS[id]);
		}
	}
	set_entvar(ent, var_nextthink, get_gametime() + 0.1);
}

@fw_CmdStart(id, uc_handle) {
	g_iUserFPS[id] = floatround(1 / (get_uc(uc_handle, UC_Msec) * 0.001));
}
Изображение

Аватар
tom1k
Извън линия
Потребител
Потребител
Мнения: 202
Регистриран на: 29 Сеп 2020, 23:50
Местоположение: Добрич
Се отблагодари: 16 пъти
Получена благодарност: 8 пъти

I'm looking for this plugin (Speedometers/FPS/Showkeys)

Мнение от tom1k » 03 Юни 2021, 03:35

Midnight1337 написа: 03 Юни 2021, 03:05 Speed meter and Player fps

Код за потвърждение: Избери целия код

#pragma semicolon 1

#include <amxmodx>
#include <fakemeta>
#include <reapi>

new g_ShowHudSync;
new g_iUserFPS[MAX_PLAYERS + 1];

public plugin_init() {
	register_plugin("[ReAPI] Speedometer & FPS", "0.0.3", "mIDnight");

	new ent = rg_create_entity("info_target");
	set_entvar(ent, var_nextthink, get_gametime() + 1.01);
	SetThink(ent, "@ent_think");
	register_forward(FM_CmdStart, "@fw_CmdStart");

	g_ShowHudSync = CreateHudSyncObj();
}

@ent_think(const ent) {
	static Float:velocity[3], Float:speed;

	for(new id = 1; id <= MaxClients; id++) {
		if(is_user_connected(id)) {
			id = get_entvar(id, var_iuser1) == 4 ? get_entvar(id, var_iuser2) : id;

			get_entvar(id, var_velocity, velocity);

			speed = vector_length(velocity);

			set_hudmessage(0, 50, 255, -1.0, 0.75, 0, 0.0, 0.1, 0.01, 0.0);
			ShowSyncHudMsg(id, g_ShowHudSync, "speed: %3.2f^n[ FPS: %d ]", speed, g_iUserFPS[id]);
		}
	}
	set_entvar(ent, var_nextthink, get_gametime() + 0.1);
}

@fw_CmdStart(id, uc_handle) {
	g_iUserFPS[id] = floatround(1 / (get_uc(uc_handle, UC_Msec) * 0.001));
}
I really like this one! Would it be possible if you add showkeys to it?
iG-Blockmaker # HNS 100aa
45.144.155.175:27018


Аватар
Midnight1337
Извън линия
Foreigner
Foreigner
Мнения: 72
Регистриран на: 15 Яну 2019, 00:53
Местоположение: Macedonia
Се отблагодари: 5 пъти
Получена благодарност: 21 пъти
Обратна връзка:

Търся този плъгин (Speedometers / FPS / Showkeys)

Мнение от Midnight1337 » 04 Юни 2021, 00:35

@tom1k I don't think its a good idea, better use an external plugin for it.
Изображение

Аватар
mi0
Извън линия
AMXX Скриптър
AMXX Скриптър
Мнения: 534
Регистриран на: 09 Дек 2016, 22:02
Се отблагодари: 97 пъти
Получена благодарност: 120 пъти
Обратна връзка:

Търся този плъгин (Speedometers / FPS / Showkeys)

Мнение от mi0 » 04 Юни 2021, 15:25

Заповядай, това e мой плъгин. В него има Spectator List и Show Keys.

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <reapi>

#define PLUGIN  "SpecInfo"
#define VERSION "1.0"
#define AUTHOR  "mi0"

#define LISTR 45
#define LISTG 89
#define LISTB 116
#define LISTX 0.7
#define LISTY 0.1

#define LISTFREQ 10

enum PlayerSettings
{
	Name[32],
	bool:Keys,
	bool:KeysSpec,
	KeysString[192],
	bool:List,
	bool:ListHide,
	SpectatingIndex,
	ListString[256],
	WatchingCount
}

new g_iThinkingEntity, iSyncHudListObj, iSyncHudKeysObj
new g_ePlayerSettings[MAX_PLAYERS + 1][PlayerSettings]

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)

	iSyncHudListObj = CreateHudSyncObj()
	iSyncHudKeysObj = CreateHudSyncObj()

	g_iThinkingEntity = rg_create_entity("info_target")
	set_entvar(g_iThinkingEntity, var_classname, "SpecInfo_Entity")
	set_entvar(g_iThinkingEntity, var_nextthink, get_gametime() + 10.0)
	RegisterHam(Ham_Think, "info_target", "OnEntityThink")
}

public client_connect(id)
{
	get_user_name(id, g_ePlayerSettings[id][Name], charsmax(g_ePlayerSettings[][Name]))
	g_ePlayerSettings[id][List] = true
	g_ePlayerSettings[id][ListHide] = false
	g_ePlayerSettings[id][Keys] = false
	g_ePlayerSettings[id][KeysSpec] = true
	Func_ClearStorages(id)
}

public client_infochanged(id)
{
	get_user_info(id, "name", g_ePlayerSettings[id][Name], charsmax(g_ePlayerSettings[][Name]))
}

public OnEntityThink(id)
{
	if (id != g_iThinkingEntity) {
		return;
	}
	
	static iListCounter
	if (++iListCounter >= LISTFREQ)
	{
		Func_UpdateList()
		iListCounter = 0
	}

	Func_UpdateKeys()

	set_entvar(g_iThinkingEntity, var_nextthink, get_gametime() + 0.1)
}

Func_UpdateKeys()
{
	new iPlayers[MAX_PLAYERS], iPlayersNum
	get_players_ex(iPlayers, iPlayersNum)
	
	new iTargetIndex
	new bool:bNeeded[33], iSpecIndex[33]
	for (new i = 0; i < iPlayersNum; i++)
	{
		iTargetIndex = iPlayers[i]
		if (is_user_alive(iTargetIndex))
		{
			if (g_ePlayerSettings[iTargetIndex][Keys])
			{
				bNeeded[iTargetIndex] = true
			}
		}
		else
		{
			if (!g_ePlayerSettings[iTargetIndex][KeysSpec] || 
				!is_user_alive((iSpecIndex[iTargetIndex] = get_entvar(iTargetIndex, var_iuser2))) ||
				bNeeded[iSpecIndex[iTargetIndex]])
			{
				continue
			}

			bNeeded[iSpecIndex[iTargetIndex]] = true
		}
	}

	for (new i; i < iPlayersNum; i++)
	{
		iTargetIndex = iPlayers[i]
		if (!bNeeded[iTargetIndex])
		{
			continue
		}

		Func_FormatButtons(iTargetIndex)
	}

	new iObserved
	for (--iPlayersNum; iPlayersNum >= 0; iPlayersNum--)
	{
		iTargetIndex = iPlayers[iPlayersNum]

		if (is_user_alive(iTargetIndex) && g_ePlayerSettings[iTargetIndex][Keys])
		{
			iObserved = iTargetIndex
		}
		else if (g_ePlayerSettings[iTargetIndex][KeysSpec])
		{
			iObserved = iSpecIndex[iTargetIndex]
		}
		else
		{
			continue
		}

		Func_ShowKeys(iTargetIndex, iObserved)
	}
}

Func_FormatButtons(id)
{
	new iButtons = get_entvar(id, var_button)

	// definately didnt steal that HUH
	formatex(g_ePlayerSettings[id][KeysString], charsmax(g_ePlayerSettings[][KeysString]), "^n^t^t%s^t^t^t%s^n^t%s %s %s^t^t%s",
			iButtons & IN_FORWARD ? "W" : " .",
			iButtons & IN_JUMP ? "Jump" : "  -",
			iButtons & IN_MOVELEFT ? "A" : ".",
			iButtons & IN_BACK ? "S" : ".",
			iButtons & IN_MOVERIGHT ? "D" : ".",
			iButtons & IN_DUCK ? "Duck" : "  -"
		)
}

Func_ShowKeys(iObs, iObsed)
{
	set_hudmessage(0, 30, 200, 0.48, 0.40, 0, 0.0, 0.1, 0.1, 0.0)
	ShowSyncHudMsg(iObs, iSyncHudKeysObj, g_ePlayerSettings[iObsed][KeysString])
}

Func_UpdateList()
{
	new iPlayers[MAX_PLAYERS], iPlayersNum, iPlayersDead[MAX_PLAYERS], iPlayersDeadNum
	new iTargetIndex, iSpectatingIndex

	get_players_ex(iPlayers, iPlayersNum, GetPlayers_ExcludeBots | GetPlayers_ExcludeHLTV)
	for (new i; i < iPlayersNum; i++)
	{
		Func_ClearStorages(iPlayers[i])
	}

	get_players_ex(iPlayersDead, iPlayersDeadNum, GetPlayers_ExcludeAlive | GetPlayers_ExcludeBots | GetPlayers_ExcludeHLTV)
	for (new i; i < iPlayersDeadNum; i++)
	{
		iTargetIndex = iPlayersDead[i]
		if ((iSpectatingIndex = get_entvar(iTargetIndex, var_iuser2)) && iSpectatingIndex != iTargetIndex)
		{
			if (!g_ePlayerSettings[iTargetIndex][ListHide])
			{
				format(g_ePlayerSettings[iSpectatingIndex][ListString], charsmax(g_ePlayerSettings[][ListString]), 
					"%s^n^t%s", g_ePlayerSettings[iSpectatingIndex][ListString], g_ePlayerSettings[iTargetIndex][Name])
			}
			g_ePlayerSettings[iSpectatingIndex][WatchingCount]++
			g_ePlayerSettings[iTargetIndex][SpectatingIndex] = iSpectatingIndex
		}
	}

	for (new i; i < iPlayersNum; i++)
	{
		iTargetIndex = iPlayers[i]
		
		if (is_user_alive(iTargetIndex))
		{
			Func_FormatList(iTargetIndex)
		}
	}

	for (--iPlayersNum; iPlayersNum >= 0; iPlayersNum--)
	{
		iTargetIndex = iPlayers[iPlayersNum]

		if (g_ePlayerSettings[iTargetIndex][List] && g_ePlayerSettings[is_user_alive(iTargetIndex) ? iTargetIndex : g_ePlayerSettings[iTargetIndex][SpectatingIndex]][WatchingCount])
		{
			Func_ShowList(iTargetIndex, is_user_alive(iTargetIndex) ? iTargetIndex : g_ePlayerSettings[iTargetIndex][SpectatingIndex])
		}
	}
}

Func_FormatList(id)
{
	format(g_ePlayerSettings[id][ListString], charsmax(g_ePlayerSettings[][ListString]), "Watching %s [%i]:%s", 
		g_ePlayerSettings[id][Name], g_ePlayerSettings[id][WatchingCount], g_ePlayerSettings[id][ListString])
}

Func_ShowList(id, iListOwner)
{
	set_hudmessage(LISTR, LISTG, LISTB, LISTX, LISTY, 0, 0.0, 1.0)
	ShowSyncHudMsg(id, iSyncHudListObj, g_ePlayerSettings[iListOwner][ListString])
}

Func_ClearStorages(id)
{
	g_ePlayerSettings[id][SpectatingIndex] = 0
	g_ePlayerSettings[id][WatchingCount] = 0
	copy(g_ePlayerSettings[id][ListString], charsmax(g_ePlayerSettings[][ListString]), "")
}
aka kurdokoleno
Catch Mod - 87.121.112.232:27021

Аватар
tom1k
Извън линия
Потребител
Потребител
Мнения: 202
Регистриран на: 29 Сеп 2020, 23:50
Местоположение: Добрич
Се отблагодари: 16 пъти
Получена благодарност: 8 пъти

Търся този плъгин (Speedometers / FPS / Showkeys)

Мнение от tom1k » 04 Юни 2021, 21:05

mi0 написа: 04 Юни 2021, 15:25 Заповядай, това e мой плъгин. В него има Spectator List и Show Keys.

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <reapi>

#define PLUGIN  "SpecInfo"
#define VERSION "1.0"
#define AUTHOR  "mi0"

#define LISTR 45
#define LISTG 89
#define LISTB 116
#define LISTX 0.7
#define LISTY 0.1

#define LISTFREQ 10

enum PlayerSettings
{
	Name[32],
	bool:Keys,
	bool:KeysSpec,
	KeysString[192],
	bool:List,
	bool:ListHide,
	SpectatingIndex,
	ListString[256],
	WatchingCount
}

new g_iThinkingEntity, iSyncHudListObj, iSyncHudKeysObj
new g_ePlayerSettings[MAX_PLAYERS + 1][PlayerSettings]

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)

	iSyncHudListObj = CreateHudSyncObj()
	iSyncHudKeysObj = CreateHudSyncObj()

	g_iThinkingEntity = rg_create_entity("info_target")
	set_entvar(g_iThinkingEntity, var_classname, "SpecInfo_Entity")
	set_entvar(g_iThinkingEntity, var_nextthink, get_gametime() + 10.0)
	RegisterHam(Ham_Think, "info_target", "OnEntityThink")
}

public client_connect(id)
{
	get_user_name(id, g_ePlayerSettings[id][Name], charsmax(g_ePlayerSettings[][Name]))
	g_ePlayerSettings[id][List] = true
	g_ePlayerSettings[id][ListHide] = false
	g_ePlayerSettings[id][Keys] = false
	g_ePlayerSettings[id][KeysSpec] = true
	Func_ClearStorages(id)
}

public client_infochanged(id)
{
	get_user_info(id, "name", g_ePlayerSettings[id][Name], charsmax(g_ePlayerSettings[][Name]))
}

public OnEntityThink(id)
{
	if (id != g_iThinkingEntity) {
		return;
	}
	
	static iListCounter
	if (++iListCounter >= LISTFREQ)
	{
		Func_UpdateList()
		iListCounter = 0
	}

	Func_UpdateKeys()

	set_entvar(g_iThinkingEntity, var_nextthink, get_gametime() + 0.1)
}

Func_UpdateKeys()
{
	new iPlayers[MAX_PLAYERS], iPlayersNum
	get_players_ex(iPlayers, iPlayersNum)
	
	new iTargetIndex
	new bool:bNeeded[33], iSpecIndex[33]
	for (new i = 0; i < iPlayersNum; i++)
	{
		iTargetIndex = iPlayers[i]
		if (is_user_alive(iTargetIndex))
		{
			if (g_ePlayerSettings[iTargetIndex][Keys])
			{
				bNeeded[iTargetIndex] = true
			}
		}
		else
		{
			if (!g_ePlayerSettings[iTargetIndex][KeysSpec] || 
				!is_user_alive((iSpecIndex[iTargetIndex] = get_entvar(iTargetIndex, var_iuser2))) ||
				bNeeded[iSpecIndex[iTargetIndex]])
			{
				continue
			}

			bNeeded[iSpecIndex[iTargetIndex]] = true
		}
	}

	for (new i; i < iPlayersNum; i++)
	{
		iTargetIndex = iPlayers[i]
		if (!bNeeded[iTargetIndex])
		{
			continue
		}

		Func_FormatButtons(iTargetIndex)
	}

	new iObserved
	for (--iPlayersNum; iPlayersNum >= 0; iPlayersNum--)
	{
		iTargetIndex = iPlayers[iPlayersNum]

		if (is_user_alive(iTargetIndex) && g_ePlayerSettings[iTargetIndex][Keys])
		{
			iObserved = iTargetIndex
		}
		else if (g_ePlayerSettings[iTargetIndex][KeysSpec])
		{
			iObserved = iSpecIndex[iTargetIndex]
		}
		else
		{
			continue
		}

		Func_ShowKeys(iTargetIndex, iObserved)
	}
}

Func_FormatButtons(id)
{
	new iButtons = get_entvar(id, var_button)

	// definately didnt steal that HUH
	formatex(g_ePlayerSettings[id][KeysString], charsmax(g_ePlayerSettings[][KeysString]), "^n^t^t%s^t^t^t%s^n^t%s %s %s^t^t%s",
			iButtons & IN_FORWARD ? "W" : " .",
			iButtons & IN_JUMP ? "Jump" : "  -",
			iButtons & IN_MOVELEFT ? "A" : ".",
			iButtons & IN_BACK ? "S" : ".",
			iButtons & IN_MOVERIGHT ? "D" : ".",
			iButtons & IN_DUCK ? "Duck" : "  -"
		)
}

Func_ShowKeys(iObs, iObsed)
{
	set_hudmessage(0, 30, 200, 0.48, 0.40, 0, 0.0, 0.1, 0.1, 0.0)
	ShowSyncHudMsg(iObs, iSyncHudKeysObj, g_ePlayerSettings[iObsed][KeysString])
}

Func_UpdateList()
{
	new iPlayers[MAX_PLAYERS], iPlayersNum, iPlayersDead[MAX_PLAYERS], iPlayersDeadNum
	new iTargetIndex, iSpectatingIndex

	get_players_ex(iPlayers, iPlayersNum, GetPlayers_ExcludeBots | GetPlayers_ExcludeHLTV)
	for (new i; i < iPlayersNum; i++)
	{
		Func_ClearStorages(iPlayers[i])
	}

	get_players_ex(iPlayersDead, iPlayersDeadNum, GetPlayers_ExcludeAlive | GetPlayers_ExcludeBots | GetPlayers_ExcludeHLTV)
	for (new i; i < iPlayersDeadNum; i++)
	{
		iTargetIndex = iPlayersDead[i]
		if ((iSpectatingIndex = get_entvar(iTargetIndex, var_iuser2)) && iSpectatingIndex != iTargetIndex)
		{
			if (!g_ePlayerSettings[iTargetIndex][ListHide])
			{
				format(g_ePlayerSettings[iSpectatingIndex][ListString], charsmax(g_ePlayerSettings[][ListString]), 
					"%s^n^t%s", g_ePlayerSettings[iSpectatingIndex][ListString], g_ePlayerSettings[iTargetIndex][Name])
			}
			g_ePlayerSettings[iSpectatingIndex][WatchingCount]++
			g_ePlayerSettings[iTargetIndex][SpectatingIndex] = iSpectatingIndex
		}
	}

	for (new i; i < iPlayersNum; i++)
	{
		iTargetIndex = iPlayers[i]
		
		if (is_user_alive(iTargetIndex))
		{
			Func_FormatList(iTargetIndex)
		}
	}

	for (--iPlayersNum; iPlayersNum >= 0; iPlayersNum--)
	{
		iTargetIndex = iPlayers[iPlayersNum]

		if (g_ePlayerSettings[iTargetIndex][List] && g_ePlayerSettings[is_user_alive(iTargetIndex) ? iTargetIndex : g_ePlayerSettings[iTargetIndex][SpectatingIndex]][WatchingCount])
		{
			Func_ShowList(iTargetIndex, is_user_alive(iTargetIndex) ? iTargetIndex : g_ePlayerSettings[iTargetIndex][SpectatingIndex])
		}
	}
}

Func_FormatList(id)
{
	format(g_ePlayerSettings[id][ListString], charsmax(g_ePlayerSettings[][ListString]), "Watching %s [%i]:%s", 
		g_ePlayerSettings[id][Name], g_ePlayerSettings[id][WatchingCount], g_ePlayerSettings[id][ListString])
}

Func_ShowList(id, iListOwner)
{
	set_hudmessage(LISTR, LISTG, LISTB, LISTX, LISTY, 0, 0.0, 1.0)
	ShowSyncHudMsg(id, iSyncHudListObj, g_ePlayerSettings[iListOwner][ListString])
}

Func_ClearStorages(id)
{
	g_ePlayerSettings[id][SpectatingIndex] = 0
	g_ePlayerSettings[id][WatchingCount] = 0
	copy(g_ePlayerSettings[id][ListString], charsmax(g_ePlayerSettings[][ListString]), "")
}

Гледам колкото се може по малко hud да използвам, и Spectator List-a ми е излишен. Трябва ми точно както на по-горния плъгин, само да се добави и Showkeys.
iG-Blockmaker # HNS 100aa
45.144.155.175:27018


Аватар
tom1k
Извън линия
Потребител
Потребител
Мнения: 202
Регистриран на: 29 Сеп 2020, 23:50
Местоположение: Добрич
Се отблагодари: 16 пъти
Получена благодарност: 8 пъти

Търся този плъгин (Speedometers / FPS / Showkeys)

Мнение от tom1k » 05 Юни 2021, 01:59

Midnight1337 написа: 04 Юни 2021, 00:35 @tom1k I don't think its a good idea, better use an external plugin for it.
Hey, plugin works well but when CT's are waiting the 10 sec before they start chasing (Hide N Seek Mod) it shows this instead of real fps:
Изображение
iG-Blockmaker # HNS 100aa
45.144.155.175:27018


Аватар
mi0
Извън линия
AMXX Скриптър
AMXX Скриптър
Мнения: 534
Регистриран на: 09 Дек 2016, 22:02
Се отблагодари: 97 пъти
Получена благодарност: 120 пъти
Обратна връзка:

Търся този плъгин (Speedometers / FPS / Showkeys)

Мнение от mi0 » 05 Юни 2021, 09:25

tom1k написа: 05 Юни 2021, 01:59 Hey, plugin works well but when CT's are waiting the 10 sec before they start chasing (Hide N Seek Mod) it shows this instead of real fps:
Изображение
That's most likely due to the way your HNS mod freezes CTs in the freeze phase. You can either disable the FPS Counter for the CTs during the freeze or find a new way to freeze them to fix that.
aka kurdokoleno
Catch Mod - 87.121.112.232:27021

Публикувай отговор
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 12 госта