Jump to content

getTime (хэлп)


Recommended Posts

Posted

Хочу вызвать функцию между 12.00 и 13.00 игрового времени. В чем ошибка?

client:

addEventHandler ( "onClientResourceStart", resourceRoot,
	function ()
	local h, m = getTime()
	if tonumber(h) >= 12 and tonumber(h) < 13 then
		    create ()
		    outputChatBox( "works", 255, 0, 255 )
	    end
	end 
, false )

 

Posted

проверка времени идет один раз только при старте ресурса. если он запускается не в промежутке между 12 и 13 то ничего не срабатывает

  • 3 years later...
Posted
On 24/12/2018 at 04:45, Markn1 said:

Хочу вызвать функцию между 12.00 и 13.00 игрового времени. В чем ошибка?

client:

addEventHandler ( "onClientResourceStart", resourceRoot,
	function ()
	local h, m = getTime()
	if tonumber(h) >= 12 and tonumber(h) < 13 then
		    create ()
		    outputChatBox( "works", 255, 0, 255 )
	    end
	end 
, false )

 

setTimer (function()
	function ()
	local h, m = getTime()
	if tonumber(h) >= 12 and tonumber(h) < 13 then
		    create ()
		    outputChatBox( "works", 255, 0, 255 )
	    end
	end 
end, 10*1000, 0)

 

  • Scripting Moderators
Posted

@AngelAlpha, ?. Не поднимайте старые темы.
Вы можете помочь в решении новых вопросов, где люди всё ещё заинтересованы в этом.

  • Sarrum locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...