Raised This Month: $ Target: $400
 0% 

Fps Limiter and restore script


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 


Thread Tools
Display Modes

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