Jump to content
  • 0

How can i check day and night in an npc dialog?


Question

Posted

if i am talking to an npc and during this dialogue the server is at night,

and the npc's speech was: 
Have a good day ~ 
i would like to check it for him to say: 
have a good night ~ instead of day

Can anyone help me with this?

best regards, ZelosAvalon

4 answers to this question

Recommended Posts

  • 0
Posted
1 hour ago, ZelosAvalon said:

if i am talking to an npc and during this dialogue the server is at night,

and the npc's speech was: 
Have a good day ~ 
i would like to check it for him to say: 
have a good night ~ instead of day

Can anyone help me with this?

best regards, ZelosAvalon

You can use these script commands:

Spoiler

*isnight()
*isday()

These functions will return 1 or 0 depending on whether the server is in night
mode or day mode. 'isnight' returns 1 if it's night and 0 if it isn't, 'isday'
the other way around. They can be used interchangeably, pick the one you like
more:

    // These two are equivalent:
    if (isday()) mes "I only prowl in the night.";
    if (isnight() != 1) mes "I only prowl in the night.";

 

And you need to configure your 'conf/battle/misc.conf' at this part:

Spoiler

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

 

 

  • Love 1
  • 0
Posted
59 minutes ago, Cretino said:

Você pode usar estes comandos de script:

  Ocultar conteúdo





     

    
     
       

 

E você precisa configurar o seu ' conf / battle / misc.conf ' nesta parte:

  Ocultar conteúdo






 



 

 

 

thanks you help me so much!!!

  • 0
Posted (edited)

Hey, if you wanna check the time real time for day and night, use this here:
 

mes (gettime(3)>= 6&&gettime(3)<= 12?"Good Morning":(gettime(3)>=13&&gettime(3)<=18?"Good Afternoon":"Good Evening"))+", "+(Sex?"Mr.":"Mrs.")+" ^0000ff"+strcharinfo(0)+"^000000!";

 

Edited by WhiteEagle
  • Love 1

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...