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?
__________________