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:
Change all code for this:Code:if(NetworkLocal && gClientLogic().localPlayer_) {
Search for this now: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)); } }
Add above:Code:void HUDDisplay::addChatMessage(int tabIndex, const char* user, const char* text, uint32_t flags)
now search for: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); }
Add aboveCode:void setBloodAlpha(float alpha);
FLASH PARTCode:void showPingFPS(int valueping, int valuefps); // TheLiciaZ CORP
HUD.as
Search for:
Add before:Code:public function setPlayerListContextMenuButton(id:int, name:String, actionID:int)
In Main.asCode:public function showPingFPS(PingStr:String, FpsStr:String) // TheLiciaZ CORP { Main.PingFps.PING.htmlText = "PING: " + PingStr; Main.PingFps.FPS.htmlText = "FPS: " + FpsStr; }
Now search for
Add beforeCode:public var api:warz.hud.HUD = null;
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!!!



Reply With Quote![[Tutorial] FPS and PING in HUD game](http://ragezone.com/hyper728.png)


