Raised This Month: $51 Target: $400
 12% 

showfps only?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
elitecs
Junior Member
Join Date: Jun 2014
Old 11-28-2015 , 04:57   showfps only?
Reply With Quote #1

i want to show only FPS not speed and like this
FPS: ..... , cuz now it's like this, example : 70 FPS :

Code:
#include < amxmodx >
#include < fakemeta >



#define PLUGIN "New hud system"
#define VERSION "0.1"


new Float:g_fGameTime[ 33 ];
new g_iFramesPer[ 33 ];
new g_iCurFPS[ 33 ];
new g_iFPS[ 33 ];


public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "falseq" );
	
	register_forward( FM_PlayerPreThink, "fwdPlayerPreThink" );
}

public client_putinserver( id )
{
	set_task( 0.1, "showHudPlayer", id, _, _, "b", _ );
}

public showHudPlayer( id )
{
	new Float:POSX, Float:POSY, Float:fVelocity[ 3 ], Float:fSpeed, RRR, GGG, BBB;
	
	if( is_user_alive( id ) )
	{
		switch( get_user_team( id ) )
		{	
			case 1:
			{
				RRR = 230;
				GGG = 10;
				BBB = 10;
			}
			
			case 2:
			{
				RRR = 10;
				GGG = 10;
				BBB = 230;
			}
		}
		
		pev( id, pev_velocity, fVelocity );
		fSpeed = vector_length( fVelocity );
		
		POSX = -1.0;
		POSY = 0.80;
		
		set_hudmessage( RRR, GGG, BBB, POSX, POSY, 0, 1.0 );
		show_hudmessage( id, "%2.3f [ SPEED ] ^n- - - - - - - - -^n%i [ FPS ]", fSpeed, g_iCurFPS[ id ] );
	}
}

public fwdPlayerPreThink( id )
{
	if( !is_user_bot( id ) )
	{
		g_fGameTime[ id ] = get_gametime( );
		
		if( g_iFramesPer[ id ] > g_fGameTime[ id ] )
		{
			g_iFPS[ id ] += 1;
		}
		
		else
		{
			g_iFramesPer[ id ] += 1;
			g_iCurFPS[ id ] = g_iFPS[ id ];
			g_iFPS[ id ] = 0;
		}
	}
}
elitecs 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 21:08.


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