Raised This Month: $ Target: $400
 0% 

Adding fps_max value to this plugin


Post New Thread Reply   
 
Thread Tools Display Modes
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
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-03-2021 , 19:33   Re: Adding fps_max value to this plugin
Reply With Quote #2

fps_max is a client-side setting, why would I want to see it all the time? Wouldn't I know what I set it to?
__________________
fysiks is offline
ddag1
Member
Join Date: Apr 2020
Old 10-03-2021 , 21:53   Re: Adding fps_max value to this plugin
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
fps_max is a client-side setting, why would I want to see it all the time? Wouldn't I know what I set it to?
This plugin will be used on a 1vs1 server. Players in my HL community tend to argue about "you're using more FPS than me" and that kind of stuff. So from now on, on tournaments, we were planning to require them to record a demo of their matches showing their realname, FPS, etc. on screen, to make sure nobody exceeds a certain limit of FPS.
ddag1 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 10-04-2021 , 14:54   Re: Adding fps_max value to this plugin
Reply With Quote #4

Who has time to review every moment of game each player does that way later? Why not log/kick them? Save hours.
__________________
DJEarthQuake is offline
ddag1
Member
Join Date: Apr 2020
Old 10-04-2021 , 15:48   Re: Adding fps_max value to this plugin
Reply With Quote #5

Quote:
Originally Posted by DJEarthQuake View Post
Who has time to review every moment of game each player does that way later? Why not log/kick them? Save hours.
I just want it to be recorded so that nobody is asking me for logs, matches will just be uploaded. And regarding kick, there aren't any good high FPS kicker out there. That's why I need this plugin edited that way.
ddag1 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 10-04-2021 , 17:28   Re: Adding fps_max value to this plugin
Reply With Quote #6

Okie doke.
Code:
#include amxmodx new iFps_kick; public plugin_init() {     iFps_kick = register_cvar("fps_kick","200")     register_plugin("FPS kick", "1.0", "SPiNX") } public client_command(id)     if(is_user_connected(id) && !is_user_bot(id) )         query_client_cvar(id, "fps_max", "cvar_result_func"); public cvar_result_func(id, const cvar[], const value[])     if(equali(cvar,"fps_max") && str_to_num(value) > get_pcvar_num(iFps_kick) || !is_str_num(value) )         server_cmd("kick #%d Your %s is %i. Do not use over %i", get_user_userid(id), cvar, str_to_num(value), get_pcvar_num(iFps_kick));
That script you posted is really bad. Get rid of it. There is nothing to show the stats and if it did does their name need reacquired every second? Whatever you did when I am assuming you sliced into it the name does not even post.
__________________
DJEarthQuake is offline
ddag1
Member
Join Date: Apr 2020
Old 10-04-2021 , 17:33   Re: Adding fps_max value to this plugin
Reply With Quote #7

Quote:
Originally Posted by DJEarthQuake View Post
Okie doke.
Code:
#include amxmodx new iFps_kick; public plugin_init() {     iFps_kick = register_cvar("fps_kick","200")     register_plugin("FPS kick", "1.0", "SPiNX") } public client_command(id)     if(is_user_connected(id) && !is_user_bot(id) )         query_client_cvar(id, "fps_max", "cvar_result_func"); public cvar_result_func(id, const cvar[], const value[])     if(equali(cvar,"fps_max") && str_to_num(value) > get_pcvar_num(iFps_kick) || !is_str_num(value) )         server_cmd("kick #%d Your %s is %i. Do not use over %i", get_user_userid(id), cvar, str_to_num(value), get_pcvar_num(iFps_kick));
That script you posted is really bad. Get rid of it. There is nothing to show the stats and if it did does their name need reacquired every second? Whatever you did when I am assuming you sliced into it the name does not even post.
Thanks but it's not what I need, and nope, the plugin does work as intended, actually I edited it adding ID and IP, I only need fps_max which I don't know how to write that part of the code.
ddag1 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 10-04-2021 , 17:41   Re: Adding fps_max value to this plugin
Reply With Quote #8

Quote:
Originally Posted by ddag1 View Post
regarding kick, there aren't any good high FPS kicker out there. That's why I need this plugin edited that way.
I just showed you one. Define good.
__________________
DJEarthQuake is offline
ddag1
Member
Join Date: Apr 2020
Old 10-04-2021 , 18:39   Re: Adding fps_max value to this plugin
Reply With Quote #9

Quote:
Originally Posted by DJEarthQuake View Post
I just showed you one. Define good.
That one is a good one, but doesn't work since when you pause the match (long story, HL uses AGMODX for 1vs1 matches) server interprets this as a FPS boost when match is unpaused. It ends up kicking everybody in the server. That's why I'd rather a plugin like the one I'm asking than a FPS limiter.
ddag1 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 10-04-2021 , 22:01   Re: Adding fps_max value to this plugin
Reply With Quote #10

Maybe neither one of us fully understands each other yet. That 'FPS boost' would need to be involved in slow hacking players CVARS. Is that what it is doing? Because this tracks the CVAR fps_max not the perpetual fluctuating fps.
__________________

Last edited by DJEarthQuake; 10-04-2021 at 22:02. Reason: Broken English
DJEarthQuake 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 14:41.


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