Raised This Month: $ Target: $400
 0% 

Info Server right


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ekoland
New Member
Join Date: Oct 2011
Old 10-18-2023 , 20:36   Info Server right
Reply With Quote #1

I need help to move the information visible on the server to the right, information is displayed under the radar now.


HTML Code:
	#include < amxmodx >		// Required by default
	#include < amxmisc >		// Required for admin_access
	#include < fakemeta >		// Required for Server FPS
	
	#pragma semicolon 1
	
	//Plugin registration
	new const
		PLUGIN_NAME	[ ] = "AMXX Info",
		PLUGIN_VERSION	[ ] = "1.5.3",
		PLUGIN_AUTHOR	[ ] = "AzaZel";
	
	// Build CVARS:
	new cvar_forum, cvar_color;
	
	new g_MsgSync;
	new maxplayers;
	new g_round 	= 0;
	new g_TeWins 	= 0;
	new g_CountWins	= 0;
	
	// FPS Function
	new Float:g_fServerGameTime [ 33 ];
	new g_iServerFPS [ 33 ];
	new g_iCurrentServerFPS [ 33 ];
	new g_iServerFrames [ 33 ];
	
	/*************************************************************/
	// Admin ACCESS
	// Default: (a)
	#define ADMIN_ACCESS		ADMIN_LEVEL_A
	/*************************************************************/
	
public plugin_init ( )
{
	// Registration
	register_plugin ( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
	
	// CVARS:
	cvar_forum 	= register_cvar ( "amx_forum", "www.eXtreamCS.com" );
	cvar_color	= register_cvar ( "amx_color", "96 96 176" );
	
	// Console command for changing: forum
	register_concmd ( "amx_forum", "ChangeForum", ADMIN_ACCESS );
	
	// Events:
	register_event ( "HLTV", "evNewRound", "a", "1=0", "2=0" );
	register_event ( "TextMsg", "evRoundRestart", "a", "2&#Game_C", "2&#Game_w" );
	
	register_event ( "SendAudio", "TskTeWin", "a", "2&%!MRAD_terwin" );
	register_event ( "SendAudio", "TskCtWin", "a", "2&%!MRAD_ctwin" );
	
	// Forwards (fakemeta); 1 = true | 0 = false;
	register_forward ( FM_StartFrame, "fwd_StartFramePost", 1 );
	
	// Task
	set_task ( 1.1, "TskShowTime", 0, "", 0, "b" );
	
	// Others
	g_MsgSync 	= CreateHudSyncObj ( );
	maxplayers	= get_maxplayers ( );
}

public TskShowTime ( )
{
	new forum [ 256 ];
	static timer [ 33 ], red, green, blue;
	get_hud_color ( red, green, blue );
	
	get_time ( "Data: %d.%m.%Y^nOra: %H:%M:%S", timer, charsmax ( timer ) );
	get_pcvar_string ( cvar_forum, forum, charsmax ( forum ) );
	
	for ( new iPlayers = 1; iPlayers <= maxplayers; iPlayers++ )
	{
		if ( !is_user_connected ( iPlayers ) || is_user_bot ( iPlayers ) )
			continue;
	
		set_hudmessage ( red, green, blue, -3.8, 0.15, 0, _, 1.0, _, _, 1 );
		ShowSyncHudMsg ( iPlayers, g_MsgSync, "%s^nWeb: %s^nRunda: %d^nScor: CT: %i - TE: %i^nServer FPS: %i", timer, forum, g_round, g_CountWins, g_TeWins, g_iCurrentServerFPS [ iPlayers ] );
	}
}

public evNewRound ( )
{
	++g_round;
}

public evRoundRestart ( )
{
	g_round 	= 0;
	g_TeWins 	= 0;
	g_CountWins	= 0;
}

public TskCtWin ( )
{
	g_CountWins++;
}

public TskTeWin ( )
{
	g_TeWins++;
}

get_hud_color ( &r, &g, &b )
{
    	new color [ 20 ];
    	static red [ 5 ], green [ 5 ], blue [ 5 ];
    	get_pcvar_string ( cvar_color, color, charsmax ( color ) );
    	parse ( color, red, charsmax ( red ), green, charsmax ( green ), blue, charsmax ( blue ) );

    	r = str_to_num ( red );
    	g = str_to_num ( green );
    	b = str_to_num ( blue );
}

public ChangeForum ( id, level, cid )
{
    	if ( !cmd_access ( id, level, cid, 1 ) )
        	return 1;
	
    	new args [ 196 ];
    	read_args ( args, charsmax ( args ) );
    	remove_quotes ( args );
        
    	set_pcvar_string ( cvar_forum, args );
	console_print ( id, "[AMX INFO] Forumul a fost schimbat cu succes pe: %s", args );
	
	// Prevent unknown amx comand in console and force plugin to handle;
    	return 1;
}

public fwd_StartFramePost ( )
{
	static iPlayers [ 32 ];
	static iPlayersNum;
	
	get_players ( iPlayers, iPlayersNum, "ch" );
	if ( !iPlayersNum )
		return FMRES_IGNORED;
	
	static id, i;
	for ( i = 0; i < iPlayersNum; i++ )
	{
		id = iPlayers [ i ];
		
		// --| FPS function modified by me to gain server's fps.
		g_fServerGameTime [ id ] = get_gametime ( );
		
		if ( g_iServerFPS [ id ] >= g_fServerGameTime [ id ] )
			g_iServerFrames [ id ] += 1;
		
		else
		{
			g_iServerFPS [ id ] += 1;
			g_iCurrentServerFPS [ id ] = g_iServerFrames[ id ];
			g_iServerFrames [ id ] = 0;
		}
	}
	return FMRES_IGNORED;
}
Ekoland is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-19-2023 , 00:29   Re: Info Server right
Reply With Quote #2

Change the "-3.8" to "1.0" in set_hudmessage().
__________________
fysiks is offline
Ekoland
New Member
Join Date: Oct 2011
Old 10-19-2023 , 00:39   Re: Info Server right
Reply With Quote #3

It works! Thank you!
Ekoland is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:49.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode