Jump to content
  • 0

auto day and night daily


Amellia sizilia sembiring

Question


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   4
  • Joined:  01/04/12
  • Last Seen:  

Hi, i tried to write my first script for auto day and night daily at 00:00 and 18:00.but many syntax error.

if( gettime(3) >= 18 ){set night;} else if ( gettime(3) >= 00 ) {set day;} else {}
Edited by Amellia sizilia sembiring
Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  387
  • Reputation:   60
  • Joined:  10/08/13
  • Last Seen:  

easy way use :

OnClockXXXX:
OnDayXXXX:
OnHourXX:
OnMinuteXX:
OnSSSXXXX:
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  


OnClock0000:

night;

end;

OnClock1800:

day;

end;


OnInit:

if ( gettime(3) < 18 ) {

night;

}

else {

day;

}

end;

OnClock0000:

night;

end;

OnClock1800:

day;

end;

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   4
  • Joined:  01/04/12
  • Last Seen:  

Emistry, i try to use your code but nothing happens. my time is 20:45. it should be night now. but its day. and i try to check @time. i get notice the game is in permanent daylight. and i think your top code wrong expression. it should be > not < 18.

Edited by Amellia sizilia sembiring
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  


OnInit:

if ( gettime(3) <= 18 ) {

day;

}

else {

night;

}

end;

OnClock0000:

day;

end;

OnClock1800:

end;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   4
  • Joined:  01/04/12
  • Last Seen:  

i get error in mapserv with parse line in line 1 stoping oninit

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  387
  • Reputation:   60
  • Joined:  10/08/13
  • Last Seen:  

U dont put the script header....

-<tab>script<tab>nightday bla bla bla

Lazy to write full scripts im on my phone. Wait for emistry reply or others.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  

script header

-	script	DayNight	-1,{
Link to comment
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
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

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