View Single Post
Old 09-18-2007, 12:09 PM   #5
[FX]Storm
Контр-адмиралПользователь
 
[FX]Storm's Avatar
 
Faction:
Кушане - киит Сомтау

Join Date: Feb 2007
Location: Пенза
Posts: 514
Re: Таймер в Homeworld2

Для тех кто нехочет таймер качать, нужно просто добвить текст которой я напишу в autoexec.lua

Вот чем они отличаються

Старый Таймер


Code:
function updateTimer()
	dr_clear("timer")
	dr_setautoclear("timer",0)
	local time = Universe_GameTime();
	local h = floor(time/3600.0);
	local m = floor(time/60.0 - h*60);
	local s = time - m*60 - h*3600;
	local str = format("Time: %2.0fh %2.0fm %3.1fs",h, m, s)
	dr_text2d("timer",0.0,0.98,str, 255,255,255)

end

Rule_AddInterval("updateTimer", 2)
Новый Таймер

Code:
function updateTimer()
	dr_clear("timer");
	dr_setautoclear("timer",0);

	local time = Universe_GameTime();

	local h = floor(time / 3600);
	local m = floor(time / 60 - h * 60);
	local s = floor(time - m * 60 - h * 3600);

	local str = format("%2.0f:%2.0f:%2.0f", h, m, s);
	dr_text2d("timer", 0, 0.9, str, 255, 255, 255);
end

Rule_AddInterval("updateTimer", 2);

Last edited by [FX]Storm : 09-18-2007 at 01:00 PM. Reason: КОДЫ
[FX]Storm is offline   Reply With Quote