Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: COD4 : getting clients com_maxfps questions

  1. #11
    Corporal voron00's Avatar
    Join Date
    Nov 2014
    Posts
    248
    Thanks
    64
    Thanked 216 Times in 116 Posts
    Quote Originally Posted by se891 View Post
    can you make the script show the speed without the tenths
    meaning if my speed is 534.03431 i want it to show 543 only since the tenths don't matter

    thanks
    PHP Code:
    calculatePlayerSpeed() {
        
    speed int(distance(self.originself.previousorigin)); // or DistanceSquared (= cheaper/faster function)
        
    self.previousorigin self.origin;
        return 
    speed;

    sudo apt-get rekt

  2. #12
    Private First Class thOuMta's Avatar
    Join Date
    Oct 2012
    Location
    France
    Posts
    191
    Thanks
    139
    Thanked 35 Times in 28 Posts
    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", -10100 );
        
    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(
    hudarray.sizei++)
        {
        
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •