Jump to content
Graf

Время сервера

Recommended Posts

Время сервера

Чтобы вывести в игру время сервера, можно добавить эти строчки в cha_timer(scripts/calculate/function.lua):

if math.mod(now_tick, 360) == 0 and now_tick > 0 then	-- Every 5 minutes, will give notice for Server Time.
	local now_hour= os.date("%H")		-- Hour Scripts
	local now_miniute= os.date("%M")	-- Minute Scripts
	local now_scend=  os.date("%S")		-- Secs Scripts
	now_hour= tonumber(now_hour)		-- Applying Hour
	now_miniute= tonumber(now_miniute)	-- Applying Minute
	now_scend= tonumber(now_scend)		-- Applying Secs
	BickerNotice ( role, "Current Server Time: "..now_hour..":"..now_miniute..":"..now_scend.."")
end

Но вывод будет такой:

6o4in7Rm-BA.jpg

 

Чтобы вывести в нашем формате, нужно написать так:

	if math.mod(now_tick, 360) == 0 and now_tick > 0 then	-- Выводит время каждые пять минут.
		local now_hour= os.date("%X")
		BickerNotice ( role, "Время сервера: "..now_hour.."")
	end

И выглядеть это будет так:

_svH4H4UvTs.jpg

 

P.S. информация взята с архива mega. Написано, что pkodev.com(закрыт).

Edited by Graf
  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...