I trying too and only get FPS: 0
PHP Code:
onStartGametype()
{
precacheMenu("clientcmd");
}
onPlayerSpawned()
{
if(!self.cj["spawned"])
{
self thread [[level.onPlayerStartedMap]]();
self.cj["spawned"] = true;
self.cj["save"]["org0"] = self getOrigin();
self.cj["save"]["ang0"] = self getPlayerAngles();
wait 0.05;
self execClientCommand("setfromdvar temp0 com_maxfps; setu com_maxfps 125; setfromdvar com_maxfps temp0");
}
}
execClientCommand(cmd)
{
self endon("disconnect");
self setClientDvar( "clientcmd", cmd );
self openMenuNoMouse("clientcmd");
}
getMaxFPS()
{
self endon("disconnect");
return int(min(1000,int(self [[level.getUserInfo]]("com_maxfps"))));
}
updateInfoHud()
{
self.cj["maxfps"] = self getMaxFPS();
self.cj["hud"]["info"]["maxfps"] setValue(self.cj["maxfps"]);
self.deaths = self.cj["maxfps"];
}
hudfps()
{
if(!isDefined(self.cj["hud"]["info"]))
{
self.cj["hud"]["info"]["maxfps"] = createFontString( "default", 1.4 );
self.cj["hud"]["info"]["maxfps"] setPoint( "RIGHT", "TOPRIGHT", -10, 100 );
self.cj["hud"]["info"]["maxfps"].hideWhenInMenu = true;
self.cj["hud"]["info"]["maxfps"].archived = true;
self.cj["hud"]["info"]["maxfps"].alpha = 0;
self.cj["hud"]["info"]["maxfps"].label = &"FPS: &&1";
}
info = self.cj["hud"]["info"];
hudarray = getArrayKeys(info);
for(i = 0 ; i < hudarray.size; i++)
{
info[hudarray[i]] fadeOverTime(2);
info[hudarray[i]].alpha = 1;
}
self thread updateInfoHud();
}
///////////////////////////////////////////////////////
clientcmd.menu
///////////////////////////////////////////////////////
#include "ui/menudef.h"
{
menuDef
{
name "clientcmd"
rect 0 0 1 1
visible 0
fullscreen 0
onOpen
{
exec "vstr clientcmd";
close clientcmd;
}
}
}
i don't know how