Jump to content
  • 0
Brynner

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

Question

is this possible when character login the server will become night. but when he logout it will be back to normal day.

Share this post


Link to post
Share on other sites

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

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