Raised This Month: $ Target: $400
 0% 

Adding fps_max value to this plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ddag1
Member
Join Date: Apr 2020
Old 10-03-2021 , 13:58   Adding fps_max value to this plugin
Reply With Quote #1

Hi there, can someone please add fps_max to this code (original author "Kensai") so that it's displayed on HUD next to player's name? Thank you so much in advance!

Code:
/*
Plugin Name: Stats Display
Author: Kensai

Description
Shows a Constant HUD display of a player's Name, Kills, Deaths, and Headshots.
Stats are retrieved from the server's stats file. SO if the server saves stats by IP, these stats are shown by IP.
Steam ID, is probably the most reliable, due to dynamic IP's.

Changelog
v1.3 - Added a Kill Death Ratio
v1.2 - Added CVAR
v1.1 - Made HUD message longer, so longer names fit, abbreviated stats
v1.0 - First version
*/

#include <amxmodx>
#include <amxmisc>
#include <csstats>

#define HUD_INTERVAL 1.0

new msgtext 

public plugin_init() 
{
	register_plugin("Stats Display","1.3","Kensai")
	
	register_cvar("amx_display","1")
	msgtext = get_user_msgid("StatusText") 
}

public client_putinserver(id)
{	
	if(get_cvar_num("amx_display") == 0)
	return PLUGIN_HANDLED
	
	set_task(HUD_INTERVAL,"ShowHUD",id)
	return PLUGIN_CONTINUE
}

public ShowHUD(id)     
{  
	if(get_cvar_num("amx_display") == 0)
	return PLUGIN_HANDLED
	
	if(!is_user_connected(id))
		return 0;	
	
	new name[33]
	get_user_name(id,name,32)
	
	
	new HUD[151] 
	
	format(HUD, 150, "| Name: %s |",name)
	message_begin(MSG_ONE, msgtext, {0,0,0}, id)  
	write_byte(0)  
	write_string(HUD)  
	message_end()  
	
	set_task(HUD_INTERVAL,"ShowHUD",id);
	
	return PLUGIN_CONTINUE
}
ddag1 is offline
 



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 23:58.


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