For anyone interested: i needed to get the data that is outputted from server command "stats" and I think it can't be get normally so I ended up using orpheu (If its possible ignore this post and tell me the way please). Is not a really elegant solution but it works.
PHP Code:
#include <amxmodx>
#include <orpheu>
new Msg[100]
public plugin_precache()
{
register_srvcmd("catch","catch")
}
public catch()
{
new OrpheuHook:hook = OrpheuRegisterHookFromName("Con_Printf","Con_Printf")
server_cmd("stats")
server_exec();
OrpheuUnregisterHook(hook)
const tokensN = 7
const tokenLen = 19
static tokens[tokensN][tokenLen+1]
for(new i=0;i<tokensN;i++)
{
trim(Msg);
strtok(Msg,tokens[i],tokenLen,Msg,charsmax(Msg),' ');
}
new Float:cpu = str_to_float(tokens[0])
new Float:in = str_to_float(tokens[1])
new Float:out = str_to_float(tokens[2])
new uptime = str_to_num(tokens[3])
new users = str_to_num(tokens[4])
new Float:fps = str_to_float(tokens[5])
new players = str_to_num(tokens[6])
server_print("CPU[%f] IN[%f] OUT[%f] UPTIME[%d] USERS[%d] FPS[%f] PLAYERS[%d]",cpu,in,out,uptime,users,fps,players)
}
public Con_Printf(a[],msg[])
{
copy(Msg,charsmax(Msg),msg)
return OrpheuSupercede
}
Code:
name "Con_Printf"
signature "Con_Printf"
arguments "char *" "char *"
library "engine"
__________________