This is very simple and many ppl was looking for this to get the time in the huddisplay like the Warz alpha (me for ex)
For a better visualization look my video tutorial Minute: 3:43 about add the basic sprite design on screen
first of all let's look for this, and uncomment it
or If you don't have the function so after this, add the code aboveCode://hudMain->setTime(CGL.GetServerGameTime());
Code:hudMain->setThreatValue(GetGraduatedZombieThreat());
Now in the HUDDisplay let's search for this
and below or above add this entery functionCode:void HUDDisplay::setThreatValue(int percent)
now in HUDDisplay let's declarate the voidCode:void HUDDisplay::setTime(__int64 utcTime) // time in displayhud { const static char* months[12] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; struct tm* tm = _gmtime64(&utcTime); char date[128]; char time[128]; sprintf(date, "%s %d, %d", gLangMngr.getString(months[tm->tm_mon]), tm->tm_mday, 1900 + tm->tm_year); sprintf(time, "%02d:%02d", tm->tm_hour, tm->tm_min); Scaleform::GFx::Value var[2]; var[0].SetString(date); var[1].SetString(time); gfxHUD.Invoke("_root.api.setTime", var, 2); }
after this
add thisCode:void setThreatValue(int percent);
ActionScript little codeCode:void setTime(__int64 utcTime); // time in displayhud
into your flash file address(src\classes\warz\hud)
open HUD.as
and search for
add below thatCode:public function setChatVisibility(show:Boolean)
Code:public function setTime (date:String, time:String):void { Main.Time.Date.text = date; Main.Time.DateShad.text = date; Main.Time.Time.text = time; Main.Time.TimeShad.text = time; }Code:ENJOY THE MINI FRUIT CAKE



Reply With Quote![[Tutorial]How to set the Time in the HUDDisplay](http://ragezone.com/hyper728.png)

