I want to check the latency in miliseconds between each server frame. After i issue the "check_fps" command i want it to save each value from server_frame(), and when I issue the command again I want it to save all the values in a file, one value at a line.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Server fps latency checker"
#define VERSION "0"
#define AUTHOR "twoj_stary"
new on_off
new Float:lastframetime
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_srvcmd("check_fps", "switch_check")
}
server_frame()
{
if(on_off)
{
// (halflife_time() - lastframetime)*1000.0 save the value
lastframetime == halflife_time()
}
}
switch_check()
{
if(!on_off)
{
server_print("starting to check latency of each server frame")
on_off = 1
}
else
{
on_off = 0
server_print("stopped checking, saving report file to %s", /*FILE+PATH*/)
}
}