Преработка на Show_rank

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
cgozzie
Извън линия
Потребител
Потребител
Мнения: 1318
Регистриран на: 13 Окт 2016, 22:10
Местоположение: Варна
Се отблагодари: 244 пъти
Получена благодарност: 42 пъти

Преработка на Show_rank

Мнение от cgozzie » 05 Дек 2021, 23:47

Искам да се махне целия код който извиква това съобщение в играта.
1.INFO_DRISS_PLAYER

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

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <csstats>
#include <csx>

#define PLUGIN "Show Rank"
#define VERSION "1.0"
#define AUTHOR "Driss  (Go Svoi)"

#define ID_SHOWHUD (taskid - TASK_SHOWHUD)

enum {
	INT_STATS_KILLS = 0,
	INT_STATS_DEATHS
};

enum (+= 100)
{
	TASK_SHOWHUD
};

const PEV_SPEC_TARGET = pev_iuser2 // Traget Spectating
new g_player_name

public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	g_player_name = register_cvar("ds_player_name", "1") // on/off

	// Chat Hook Rank Or /Rank
	register_clcmd( "say", "Chat_Player_Rank" );
	register_clcmd( "say_team", "Chat_Player_Rank" );
	
	// Hud Player Name + Rank
	register_event("StatusValue","show_status_player","be","1=2","2!0")

	// Language files
	register_dictionary("Driss_rank.txt")
}

public Chat_Player_Rank(id)
{	
	static STRING_ARGUMENT[ 11 ];
	read_argv( 1, STRING_ARGUMENT, charsmax( STRING_ARGUMENT ) );

	if( equali( STRING_ARGUMENT, "rank" ) || equali( STRING_ARGUMENT, "/rank" ) ) 
	{
		new INT_RANK_POS, STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_NAME[ 32 ];
		INT_RANK_POS = get_user_stats( id, STRING_STATS, STRING_BODY );

		get_user_name( id, STRING_NAME, charsmax( STRING_NAME ) );
		
		print_chatColor(0, "%L",LANG_PLAYER, "CHAT_INFO" ,STRING_NAME, INT_RANK_POS, get_statsnum( ) , STRING_STATS[ INT_STATS_KILLS ], STRING_STATS[ INT_STATS_DEATHS ],
		float( STRING_STATS[ INT_STATS_KILLS ] ) * 1.002 / float( STRING_STATS[ INT_STATS_DEATHS ] ) * 1.002 * 30.346647 );

		client_cmd( id, "spk items/medshotno1.wav" );

	}
}

public client_putinserver(id)
{
	if (!is_user_bot(id))
	{
		// Set the custom HUD display task
		set_task(1.0, "ShowHUD", id+TASK_SHOWHUD, _, _, "b")
	}
}

public ShowHUD(taskid)
{
	static id
	new INT_RANK_POS, STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_NAME[ 32 ];
	INT_RANK_POS = get_user_stats( id, STRING_STATS, STRING_BODY );

	get_user_name( id, STRING_NAME, charsmax( STRING_NAME ) );
	
	id = ID_SHOWHUD;
	// Player died?
	if (!is_user_alive(id))
	{
		// Get spectating target
		id = pev(id, PEV_SPEC_TARGET)
		
		// Target not alive
		if (!is_user_alive(id))return;
	}

	static red, green, blue
	
	if (cs_get_user_team(id) == CS_TEAM_T) // Terrorest
	{
		red = 255
		green = 0
		blue = 0
	}
	else // CT
	{
		red = 0
		green = 255
		blue = 0
	}

	if (id != ID_SHOWHUD)
	{
		set_hudmessage(255, 0, 255, -1.0, 0.80, 0, 7.0, 1.2)
		show_hudmessage(ID_SHOWHUD,"%L",LANG_PLAYER, "SPECTATING_PLAYER", STRING_NAME, INT_RANK_POS, get_statsnum( ) , STRING_STATS[ INT_STATS_KILLS ], STRING_STATS[ INT_STATS_DEATHS ],
		float( STRING_STATS[ INT_STATS_KILLS ] ) * 1.002 / float( STRING_STATS[ INT_STATS_DEATHS ] ) * 1.002 * 30.346647 );
	}
	else
	{
		set_hudmessage(red, green, blue, -1.0, 0.91, 0, 7.0, 1.2)		
		show_hudmessage(ID_SHOWHUD,"%L",LANG_PLAYER,"ON_PLAYER", INT_RANK_POS, get_statsnum( ),  STRING_STATS[ INT_STATS_KILLS ], STRING_STATS[ INT_STATS_DEATHS ], 
		float( STRING_STATS[ INT_STATS_KILLS ] ) * 1.002 / float( STRING_STATS[ INT_STATS_DEATHS ] ) * 1.002 * 30.346647 );
	}
}

public show_status_player(id)
{
    	new name[32],pid = read_data(2)
    	get_user_name(pid,name,31)
	
	new INT_RANK_POS, STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_NAME[ 32 ];
	INT_RANK_POS = get_user_stats( pid, STRING_STATS, STRING_BODY );

	get_user_name( pid, STRING_NAME, charsmax( STRING_NAME ) );
	

	if (!(cs_get_user_team(pid) == CS_TEAM_T) && !(cs_get_user_team(id) == CS_TEAM_T) && (get_pcvar_num(g_player_name) == 1) )
	{
		set_hudmessage(153,50,204, -1.0, 0.60, 2, 0.05, 0.1, 0.01, 01.0, -1);
		show_hudmessage(id, "%L",LANG_PLAYER, "INFO_DRISS_PLAYER", name, INT_RANK_POS, get_statsnum( ) , STRING_STATS[ INT_STATS_KILLS ], STRING_STATS[ INT_STATS_DEATHS ],
		float( STRING_STATS[ INT_STATS_KILLS ] ) * 1.002 / float( STRING_STATS[ INT_STATS_DEATHS ] ) * 1.002 * 30.346647 );
	}
	if((cs_get_user_team(id) == CS_TEAM_T) && (cs_get_user_team(pid) == CS_TEAM_T) && (get_pcvar_num(g_player_name) == 1))
	{
		set_hudmessage(255,0,0,-1.0,0.60,1, 0.01, 3.0, 0.01, 0.01, -1);
		show_hudmessage(id, "%L",LANG_PLAYER,"INFO_DRISS_PLAYER", name, INT_RANK_POS, get_statsnum( ) , STRING_STATS[ INT_STATS_KILLS ], STRING_STATS[ INT_STATS_DEATHS ],
		float( STRING_STATS[ INT_STATS_KILLS ] ) * 1.002 / float( STRING_STATS[ INT_STATS_DEATHS ] ) * 1.002 * 30.346647 );
	}
}


stock print_chatColor(const id,const input[], any:...)
{
	new msg[191], players[32], count = 1;
	vformat(msg,190,input,3);
	replace_all(msg,190,"!g","^x04");// green
	replace_all(msg,190,"!n","^x01");// normal
	replace_all(msg,190,"!t","^x03");// team
    
	if (id) players[0] = id; else get_players(players,count,"ch");
	for (new i=0;i<count;i++)
	if (is_user_connected(players[i]))
	{
		message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]);
		write_byte(players[i]);
		write_string(msg);
		message_end();
	}
}
Изображение

Аватар
Lethality
Извън линия
VHE Mapper
VHE Mapper
Мнения: 211
Регистриран на: 06 Яну 2020, 15:41
Местоположение: Германия
Се отблагодари: 34 пъти
Получена благодарност: 50 пъти
Обратна връзка:

Преработка на Show_rank

Мнение от Lethality » 06 Дек 2021, 04:10

По принцип има CVAR за изключване на тези HUD съобщения..

ds_player_name 1/0

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

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <csstats>
#include <csx>

#define PLUGIN "Show Rank"
#define VERSION "1.0"
#define AUTHOR "Driss  (Go Svoi)"

#define ID_SHOWHUD (taskid - TASK_SHOWHUD)

enum {
	INT_STATS_KILLS = 0,
	INT_STATS_DEATHS
};

enum (+= 100)
{
	TASK_SHOWHUD
};

const PEV_SPEC_TARGET = pev_iuser2 // Traget Spectating

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

	// Chat Hook Rank Or /Rank
	register_clcmd( "say", "Chat_Player_Rank" );
	register_clcmd( "say_team", "Chat_Player_Rank" );

	// Language files
	register_dictionary("Driss_rank.txt")
}

public Chat_Player_Rank(id)
{	
	static STRING_ARGUMENT[ 11 ];
	read_argv( 1, STRING_ARGUMENT, charsmax( STRING_ARGUMENT ) );

	if( equali( STRING_ARGUMENT, "rank" ) || equali( STRING_ARGUMENT, "/rank" ) ) 
	{
		new INT_RANK_POS, STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_NAME[ 32 ];
		INT_RANK_POS = get_user_stats( id, STRING_STATS, STRING_BODY );

		get_user_name( id, STRING_NAME, charsmax( STRING_NAME ) );
		
		print_chatColor(0, "%L",LANG_PLAYER, "CHAT_INFO" ,STRING_NAME, INT_RANK_POS, get_statsnum( ) , STRING_STATS[ INT_STATS_KILLS ], STRING_STATS[ INT_STATS_DEATHS ],
		float( STRING_STATS[ INT_STATS_KILLS ] ) * 1.002 / float( STRING_STATS[ INT_STATS_DEATHS ] ) * 1.002 * 30.346647 );

		client_cmd( id, "spk items/medshotno1.wav" );

	}
}

public client_putinserver(id)
{
	if (!is_user_bot(id))
	{
		// Set the custom HUD display task
		set_task(1.0, "ShowHUD", id+TASK_SHOWHUD, _, _, "b")
	}
}

public ShowHUD(taskid)
{
	static id
	new INT_RANK_POS, STRING_STATS[ 8 ], STRING_BODY[ 8 ], STRING_NAME[ 32 ];
	INT_RANK_POS = get_user_stats( id, STRING_STATS, STRING_BODY );

	get_user_name( id, STRING_NAME, charsmax( STRING_NAME ) );
	
	id = ID_SHOWHUD;
	// Player died?
	if (!is_user_alive(id))
	{
		// Get spectating target
		id = pev(id, PEV_SPEC_TARGET)
		
		// Target not alive
		if (!is_user_alive(id))return;
	}

	static red, green, blue
	
	if (cs_get_user_team(id) == CS_TEAM_T) // Terrorest
	{
		red = 255
		green = 0
		blue = 0
	}
	else // CT
	{
		red = 0
		green = 255
		blue = 0
	}

	if (id != ID_SHOWHUD)
	{
		set_hudmessage(255, 0, 255, -1.0, 0.80, 0, 7.0, 1.2)
		show_hudmessage(ID_SHOWHUD,"%L",LANG_PLAYER, "SPECTATING_PLAYER", STRING_NAME, INT_RANK_POS, get_statsnum( ) , STRING_STATS[ INT_STATS_KILLS ], STRING_STATS[ INT_STATS_DEATHS ],
		float( STRING_STATS[ INT_STATS_KILLS ] ) * 1.002 / float( STRING_STATS[ INT_STATS_DEATHS ] ) * 1.002 * 30.346647 );
	}
	else
	{
		set_hudmessage(red, green, blue, -1.0, 0.91, 0, 7.0, 1.2)		
		show_hudmessage(ID_SHOWHUD,"%L",LANG_PLAYER,"ON_PLAYER", INT_RANK_POS, get_statsnum( ),  STRING_STATS[ INT_STATS_KILLS ], STRING_STATS[ INT_STATS_DEATHS ], 
		float( STRING_STATS[ INT_STATS_KILLS ] ) * 1.002 / float( STRING_STATS[ INT_STATS_DEATHS ] ) * 1.002 * 30.346647 );
	}
}

stock print_chatColor(const id,const input[], any:...)
{
	new msg[191], players[32], count = 1;
	vformat(msg,190,input,3);
	replace_all(msg,190,"!g","^x04");// green
	replace_all(msg,190,"!n","^x01");// normal
	replace_all(msg,190,"!t","^x03");// team
    
	if (id) players[0] = id; else get_players(players,count,"ch");
	for (new i=0;i<count;i++)
	if (is_user_connected(players[i]))
	{
		message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]);
		write_byte(players[i]);
		write_string(msg);
		message_end();
	}
}

Аватар
cgozzie
Извън линия
Потребител
Потребител
Мнения: 1318
Регистриран на: 13 Окт 2016, 22:10
Местоположение: Варна
Се отблагодари: 244 пъти
Получена благодарност: 42 пъти

Преработка на Show_rank

Мнение от cgozzie » 06 Дек 2021, 09:14

Да сега го видях но по-добре така благодаря ти... :lock:
Изображение

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

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

Кой е на линия

Потребители разглеждащи този форум: pok4 и 16 госта