Jump to content
  • 0
Brynner

how can i make auto change day and night when character login

Question

1 answer to this question

Recommended Posts

  • 0

Yes, it's possible. Take a look at these script commands:

*day;*night;These two commands will switch the entire server between day and night moderespectively. If your server is set to cycle between day and night byconfiguration, it will eventually return to that cycle.Example:-	script	DayNight	-1,{OnClock0600:	day;	end;OnInit:	// setting correct mode upon server start-up	if(gettime(3)>=6 && gettime(3)<18) end;OnClock1800:	night;	end;}This script allows to emulate the day/night cycle as the server does, but alsoallows triggering additional effects upon change, like announces, gifts, etc.The day/night cycle set by configuration should be disabled when this script is used.

 
Your script would be like this one (change Name_of_the_character to the name of the character you want this script to run with):

-	script	nightanday	-1,{OnPCLoginEvent:	if(strcharinfo(0) == "Name_of_the_character") night;	end;OnPCLogoutEvent:	if(strcharinfo(0) == "Name_of_the_character") day;	end;}

 

Remember to disable the day and night cycle on your conf/battle/misc.conf file to make this work properly:

// Choose if server begin with night (yes) or day (no)night_at_start: no// Define duration in msec of the day (default: 7200000 = 2 hours)// Set to 0 to disable day cycle (but not @day GM command).// Except 0, minimum is 60000 (1 minute)day_duration: 0// Define duration in msec of the night (default: 1800000 = 30 min)// Set to 0 to disable night cycle (but not @night GM command).// Except 0, minimum is 60000 (1 minute)night_duration: 0

This basic script should work with these configurations. Any further modifications are up to you.

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
Answer this question...

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

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.