Jump to content
flamyman1412

Help Me Portal Chaos

Recommended Posts

function can_open_entry_garner2( map ) 
--	Specific portal time to open
	local hour = os.date ("%H")
   	local hournum = tonumber(hour)
	if hournum == 10 or hournum == 14 or hournum == 18 or hournum == 21 then -- (I would recommend change 21 to 22, just to keep it consistant.)
		return 1
	else
		return 0
	end
end 

 

Edited by GOAT
  • Thanks 1

Nissan-GT-R.gif

Share this post


Link to post
Share on other sites
35 minutes ago, GOAT said:

function can_open_entry_garner2( map ) 
	Specific portal time to open
	local hour = os.date ("%H")
   	local hournum = tonumber(hour)
	if hournum == 10 or hournum == 14 or hournum == 18 or hournum == 21 then -- (I would recommend change 21 to 22, just to keep it consistant.)
		return 1
	else
		return 0
	end
end 

 

Thank you very much. I will try it.

 

22 is the final round that opens the portal?

Edited by flamyman1412

Share this post


Link to post
Share on other sites
20 hours ago, GOAT said:

function can_open_entry_garner2( map ) 
	Specific portal time to open
	local hour = os.date ("%H")
   	local hournum = tonumber(hour)
	if hournum == 10 or hournum == 14 or hournum == 18 or hournum == 21 then -- (I would recommend change 21 to 22, just to keep it consistant.)
		return 1
	else
		return 0
	end
end 

 

I tested it and it can't be used.
@GOAT

Edited by flamyman1412

Share this post


Link to post
Share on other sites

make sure u do:
function can_open_entry_garner2( map )

--Specific portal time to open

local hour = os.date ("%H")

 

instead of :

function can_open_entry_garner2( map )

Specific portal time to open

local hour = os.date ("%H")

  • Like 2

Share this post


Link to post
Share on other sites
2 hours ago, flamyman1412 said:

I tested it and it can't be used.
@GOAT

As @DangThao mention, comment the Specific portal time to open, my apologies.


Nissan-GT-R.gif

Share this post


Link to post
Share on other sites
2 hours ago, DangThao said:

make sure u do:
function can_open_entry_garner2( map )

--Specific portal time to open

local hour = os.date ("%H")

 

instead of :

function can_open_entry_garner2( map )

Specific portal time to open

local hour = os.date ("%H")

Thank you. I will try testing again.

 

Share this post


Link to post
Share on other sites
4 hours ago, DangThao said:

make sure u do:
function can_open_entry_garner2( map )

--Specific portal time to open

local hour = os.date ("%H")

 

instead of :

function can_open_entry_garner2( map )

Specific portal time to open

local hour = os.date ("%H")

Error notification and when editing cannot use the command
Portal is still open by normal hours every 2 hours.

@DangThao

image.png.7bfaadcf0dc28ba25b3bb6ba953c5679.png

Share this post


Link to post
Share on other sites
10 hours ago, flamyman1412 said:

Error notification and when editing cannot use the command
Portal is still open by normal hours every 2 hours.

@DangThao

image.png.7bfaadcf0dc28ba25b3bb6ba953c5679.png

See the -- ? before the words specific portal time to open
U need the --
in order to load it correctly or else lua gonna read the text
specific portal time to open

which will give u error

  • Thanks 1

Share this post


Link to post
Share on other sites
11 hours ago, DangThao said:

See the -- ? before the words specific portal time to open
U need the --
in order to load it correctly or else lua gonna read the text
specific portal time to open

which will give u error

Thank you for your advice But I can't do it. Sorry.

Share this post


Link to post
Share on other sites
On 7/12/2019 at 8:45 PM, GOAT said:

function can_open_entry_garner2( map ) 
--	Specific portal time to open
	local hour = os.date ("%H")
   	local hournum = tonumber(hour)
	if hournum == 10 or hournum == 14 or hournum == 18 or hournum == 21 then -- (I would recommend change 21 to 22, just to keep it consistant.)
		return 1
	else
		return 0
	end
end 

 

Just do this:
 

function can_open_entry_garner2( map )
	local hour = os.date ("%H")
   	local hournum = tonumber(hour)
	if hournum == 10 or hournum == 14 or hournum == 18 or hournum == 21 then
		return 1
	else
		return 0
	end
end

@flamyman1412, remove the comments all together if you're having trouble.

Share this post


Link to post
Share on other sites
4 hours ago, Angelix said:

Just do this:
 


function can_open_entry_garner2( map )
	local hour = os.date ("%H")
   	local hournum = tonumber(hour)
	if hournum == 10 or hournum == 14 or hournum == 18 or hournum == 21 then
		return 1
	else
		return 0
	end
end

@flamyman1412, remove the comments all together if you're having trouble.

I've tried  It's open, but it doesn't go as expected.

 

It opens every 2 hours.  And not closed at the specified time, such as opening 10am and closing at 12am

Share this post


Link to post
Share on other sites
function init_entry(map)

    SetMapEntryMapName(map, "darkblue")
    SetMapEntryTime(map, "2006/10/18/14/0", "0/4/0", "0/0/30", "0/0/45")

end

 

function can_open_entry_garner2( map ) 
	local hour = os.date ("%H")
   	local hournum = tonumber(hour)
	if hournum == 10 or hournum == 14 or hournum == 18 or hournum == 22 then
		return 1
	else
		return 0
	end
end 

 


Nissan-GT-R.gif

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...