Jump to content
OldHero

Map Timing

Recommended Posts

1 hour ago, OldHero said:

Hello i have question how i can make example cod map open every 2pm,am  ,5 pm,am / 8pm,am 

You don't know mathematics?

Share this post


Link to post
Share on other sites

Ik this but i dont want it open like it every 3h i want just like 2 pm 5 pm and 8 pm u can make me that so i will understand than better xD cleaner if its not prob bro ?

Share this post


Link to post
Share on other sites

@OldHero


 

Quote

function can_open_entry_YOURMAP( map ) 

    local Now_Time = GetNowTime()
    local Day_of_Week = GetNowWeek()

        if Day_of_Week == 6 or Day_of_Week == 7 then

            if Now_Time == 0 or Now_Time == 12 then
                return 1
            else
                return 0
            end
        end
end 

 

This script will let your map open only on Saturday and Sunday, only at 12 AM and 12 PM.

 

Not tested, if u use it tell me how it goes.

  • Like 1

logo-big.png   logo.png

                                   Sunny Go! Online                                                                    pko.host                                                 

Share this post


Link to post
Share on other sites

@OldHero

What the problem? :smile:

 

Just delete if condition for days

function can_open_entry_YOURMAP( map ) 

    local Now_Time = GetNowTime()

	if Now_Time == 0 or Now_Time == 12 then
		return 1
	else
		return 0
	end

end 

 

  • Like 1

Share this post


Link to post
Share on other sites
6 minutes ago, OldHero said:

 

@Totoka             Hm bro can you make me 1x example it like dw open every  2,4,6,8 pm and am  hmm ?

function can_open_entry_deathcircle( map ) 

    local Now_Time = GetNowTime()

            if Now_Time == 2 or Now_Time == 4 or Now_Time == 6 or Now_Time == 8 or Now_Time == 14 or Now_Time == 16 or Now_Time == 18 or Now_time == 20 then
                return 1
            else
                return 0
        end
end 

 

 

  • Like 1

Kind regards, AG.

Share this post


Link to post
Share on other sites
Just now, Ximboliex said:

@OldHero;

Every 2 hours

 


    SetMapEntryTime(map, "2016/5/27/1/0", "0/2/0", "0/0/40", "0/0/25")

he dont want it every 2 hours he want 2,4,6,8 so he must use can_open_entry


Kind regards, AG.

Share this post


Link to post
Share on other sites

Idk why you would want this but try @J0k3r's script it should work. Just modify now time to whatever time u want it to open.

 

  • Like 1

logo-big.png   logo.png

                                   Sunny Go! Online                                                                    pko.host                                                 

Share this post


Link to post
Share on other sites
7 minutes ago, Shako said:

Idk why you would want this but try @J0k3r's script it should work. Just modify now time to whatever time u want it to open.

 

can_open_entry functions a  good funcs i tested it

and u could put this 

 

local Hour   = os.date("%I")    -- Hour Scripts
        local Minute = os.date("%M")    -- Minute Scripts
        local Second = os.date("%p")    -- AM/PM
        local Day   = os.date("%d")    -- Day Scripts
        local Month = os.date("%b")    -- Month Scripts
        local Year = os.date("%Y")    -- Year Scripts
        local DD = os.date("%A") -- Day Name
print( "your MAPNAME Opened At:"..Day..":"..Hour..":"..Minute..":"..Second.."" )
below this functions function after_create_entry(entry)   in entry.lua
 this is how  i test my maps while sleeping
and this will print when ur port opened in ur gs xD

 

Edited by J0k3r

Kind regards, AG.

Share this post


Link to post
Share on other sites
3 minutes ago, OldHero said:

@J0k3r hey bro i made this same way but  example i made 2 pm and i want ca port close at 30 and map at 40 .. hmm what do i need add ?

can_open_entry only control when port open , so u can control when close from here 
 SetMapEntryTime(map, "2006/10/18/1/0", "0/0/0", "0/0/0", "0/0/0")  as normal


Kind regards, AG.

Share this post


Link to post
Share on other sites
1 hour ago, Totoka said:

hey @OldHero

here a pic from DW ctrl.lua:

map-time-explanation.png

Pay attention at these numbers, you don't recognise them at all?

 

@OldHero

Edited by Shako

logo-big.png   logo.png

                                   Sunny Go! Online                                                                    pko.host                                                 

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