[Tutorial] FPS and PING in HUD game

Results 1 to 5 of 5
  1. #1
    Valued Member obamabf2 is offline
    MemberRank
    Jan 2014 Join Date
    Parnamirim (RioLocation
    123Posts

    [Tutorial] FPS and PING in HUD game

    Hello RageZone! First of all sorry if you have any English errors I'm using google translator.

    In this tutorial you will learn about that FPS and PING in the style of src UNITED...

    In 3 steps src game, flash game and script game...


    Step 1

    WarZ.sln

    Search for:

    Code:
    if(NetworkLocal && gClientLogic().localPlayer_)
          {
    Change all code for this:
    Code:
    if(NetworkLocal && gClientLogic().localPlayer_) // TheLiciaZ CORP
          {
                if(gClientLogic().net_->lastPing_ > 0)
                Font_Label->PrintF((r3dRenderer->ScreenW) / 2, 0, r3dColor(255,0,0), "PING: %i", gClientLogic().net_->lastPing_);
                if (r_render_in_game_HUD->GetBool()  && hudPause && !hudPause->isActive())//do not show FPS: and PING: if HUD disabled 
                {
                      float fps = r3dGetAvgFPS();
                      hudMain->showPingFPS(gClientLogic().net_->lastPing_, int(fps));
                }
          }
    Search for this now:
    Code:
    void HUDDisplay::addChatMessage(int tabIndex, const char* user, const char* text, uint32_t flags)
    Add above:
    Code:
    void HUDDisplay::showPingFPS(int valueping, int valuefps) // TheLiciaZ CORP
    {
          if (!Inited) return;
     
          //PING
          int Ping = valueping;
          bool pingnormal = Ping < 100;
          bool pinglow = (Ping > 100 && Ping < 200);
          bool pinghight = Ping > 200;
          char PingStr[64] = { 0 };
     
          if (pingnormal)
                sprintf(PingStr, "<font color=\"#FFFFFF\">%d</font>", valueping);
          else if (pinglow)
                sprintf(PingStr, "<font color=\"#FF9900\">%d</font>", valueping);
          else if (pinghight)
                sprintf(PingStr, "<font color=\"#CC0000\">%d</font>", valueping);
     
          //FPS
          float fps = r3dGetAvgFPS();
          bool fpsvaluemax = fps > 40.0f;
          bool fpsvaluemed = (fps > 20.0f && fps < 40.0f);
          bool fpsvaluemin = fps < 20.0f;
          char FpsStr[64] = { 0 };
     
          if (fpsvaluemax)
                sprintf(FpsStr, "<font color=\"#FFFFFF\">%d</font>", valuefps);
          else if (fpsvaluemed)
                sprintf(FpsStr, "<font color=\"#FF9900\">%d</font>", valuefps);
          else if (fpsvaluemin)
                sprintf(FpsStr, "<font color=\"#CC0000\">%d</font>", valuefps);  // TheLiciaZ CORP
         
          Scaleform::GFx::Value var[2];
          var[0].SetString(PingStr);
          var[1].SetString(FpsStr);
          gfxHUD.Invoke("_root.api.showPingFPS", var, 2);
    }
    now search for:
    Code:
    void  setBloodAlpha(float alpha);
    Add above
    Code:
    void  showPingFPS(int valueping, int valuefps); // TheLiciaZ CORP
    FLASH PART

    HUD.as

    Search for:
    Code:
    public function setPlayerListContextMenuButton(id:int, name:String, actionID:int)
    Add before:
    Code:
    public function showPingFPS(PingStr:String, FpsStr:String) // TheLiciaZ CORP
                                      {
                                                    Main.PingFps.PING.htmlText = "PING: " + PingStr;
                                                    Main.PingFps.FPS.htmlText = "FPS: " + FpsStr;
                                     }
    In Main.as
    Now search for
    Code:
    public    var api:warz.hud.HUD = null;
    Add before
    Code:
    public var PingFps:MovieClip; // TheLiciaZ CORP


    Create action script in WARZ_HUD.fla




    Credits create CODE Alexx VERMELHO

    Credits decode HUD and SCRIPTs ME!!!

    TheLiciaZ FOREVER!!!


  2. #2
    Apprentice Tobiasxc12345 is offline
    MemberRank
    Dec 2014 Join Date
    16Posts

    Re: [Tutorial] FPS and PING in HUD game

    I have to say its good for the guys who doesnt know how to make that but pls why you guys only do easy things... this is done in 2 minutes no joke...

  3. #3
    I can do it!, i guess... Sylvanas1234 is offline
    MemberRank
    May 2014 Join Date
    PolandLocation
    760Posts

    Re: [Tutorial] FPS and PING in HUD game

    if you have to make video with your voice recorded.. at leat do that in english next time ;p

  4. #4
    Valued Member Krecikv15 is offline
    MemberRank
    Mar 2014 Join Date
    Augsburg, GermaLocation
    101Posts

    Re: [Tutorial] FPS and PING in HUD game

    I have problem with my flash part

    http://imgur.com/a/bzWR2

    And he have more folders etc. how to do it ???

    http://imgur.com/a/YtaUE

    And how to make this HUD.as script ? i am new in Flash xD

  5. #5
    Valued Member khongtuong is offline
    MemberRank
    Aug 2004 Join Date
    ChaosLocation
    148Posts

    Re: [Tutorial] FPS and PING in HUD game

    Quote Originally Posted by Tobiasxc12345 View Post
    I have to say its good for the guys who doesnt know how to make that but pls why you guys only do easy things... this is done in 2 minutes no joke...
    why dont you do the hard things and share it ? why just wait for someone make easy things and then complain about ? no joke



Advertisement