Raised This Month: $ Target: $400
 0% 

Fps Limiter and restore script


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
-X3N- | DEFAULT
Junior Member
Join Date: Aug 2005
Location: Right Behind You
Old 08-31-2005 , 04:38   Fps Limiter and restore script
Reply With Quote #1

I need some help completing this script. It's purpose is to store the fps_max of connecting clients so that after the plugin is stopped, the original value can be returned to the player. Please help me understand why the value of the "fps_max" is not being stored correctly here.

Code:
#include <amxmodx>

new fps[33]

public plugin_init(){ 
	register_plugin("FpsLimit","1.0","-Default-")
	register_concmd("amx_fpslimit", "on", ADMIN_LEVEL_A, "amx_fpslimit <on|off> or <1|0>")
	return PLUGIN_CONTINUE 
}

public client_connect(id){
	get_user_info(id, "fps_max", fps[id], 31)
}


public on(id){
	if (id && !((get_user_flags(id) & ADMIN_LEVEL_A)))
		{
		client_print(id, print_console, "[AMXX] You do not have access to this command")
		return PLUGIN_CONTINUE
	}
	new arg[8]
	read_argv(1, arg, 7)
	
	if((equali(arg, "off"))||(equali(arg, "0")))
	{
		set_task(1.0,"resetfps")
		client_print(id, print_console, "[AMXX] DISABLED FPS Limit mode")
		client_print(0, print_chat, "[AMXX] DISABLED FPS Limit mode")		
		
	}
	else
	{
		//set_task(1.0,"setfps",_,_,_,"b")
		set_task(1.0,"setfps")
		client_print(id, print_console, "[AMXX] ENABLED FPS Limit mode")
		client_print(0, print_chat, "[AMXX] ENABLED FPS Limit mode")
	}
	return PLUGIN_HANDLED	
	
}

public setfps(id) {
	//if(check == 1){
	new players[32], num, i, player 
	get_players(players,num)
	for(i=0;i<num;i++) { 
		player = players[i]
		client_cmd(player,"fps_max 101") 
		client_cmd(player,"fps_modem 0")
	} 
	//}
	return PLUGIN_CONTINUE
}

public resetfps(id){
	new Players[32] 
	new num, i, player
	get_players(Players, num, "c") 
	for (i=0; i<num; i++){
		player = Players[i]
		//client_cmd(player,"fps_max %s",fps[player])
		client_print(0, print_chat, "Player %i @ %sfps ",player,fps[player])
		//client_cmd(players[i],"fps_max %i",str_to_num(fps[players[i]]))
	}
	return PLUGIN_CONTINUE	
}

**update** it seems that it is impossible to get the value of "fps_max" i have tried so many things, does anybody know how to get this value?
__________________
-X3N- | DEFAULT is offline
Send a message via AIM to -X3N- | DEFAULT Send a message via MSN to -X3N- | DEFAULT
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-31-2005 , 15:15  
Reply With Quote #2

You may be able to fetch it with the upcoming query_client_cvar function.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
-X3N- | DEFAULT
Junior Member
Join Date: Aug 2005
Location: Right Behind You
Old 08-31-2005 , 15:18  
Reply With Quote #3

Oooo, sounds kinda sexy... when can i expect all this sexiness?
__________________
-X3N- | DEFAULT is offline
Send a message via AIM to -X3N- | DEFAULT Send a message via MSN to -X3N- | DEFAULT
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-31-2005 , 15:22  
Reply With Quote #4

Quote:
Originally Posted by BAILOPAN
It'll go into 1.56 then.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 08-31-2005 , 19:02  
Reply With Quote #5

Kind of offtopic, but for that new function. Is it for ALL cvars? Or just some.
pdoubleopdawg is offline
darkcloud9sgl
Member
Join Date: Dec 2004
Old 08-31-2005 , 19:59  
Reply With Quote #6

i wouldnt recommand makeing a thing for the fps just to leave it alone
darkcloud9sgl is offline
Mustaffa35
Senior Member
Join Date: Feb 2012
Old 02-17-2012 , 10:50   Re: Fps Limiter and restore script
Reply With Quote #7

a supermıs
Mustaffa35 is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 02-17-2012 , 11:20   Re: Fps Limiter and restore script
Reply With Quote #8

fps_max 101 in amxx.cfg (for example)
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-17-2012 , 11:50   Re: Fps Limiter and restore script
Reply With Quote #9

Quote:
Originally Posted by Devil259 View Post
fps_max 101 in amxx.cfg (for example)
That won't affect players at all (except the LAN owner if on a LAN server).
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 02-17-2012 , 14:04   Re: Fps Limiter and restore script
Reply With Quote #10

So, why a lot of servers set it in server.cfg ?
__________________
You can do anything you set your mind to, man.

Devil259 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:26.


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