Sunrise and Sunset
#1

It is possible to simulate daylight and depending on the real winter time and summer time?
Winter sun sets earlier than summer.

Its possible this in game?
Reply
#2

You may be able to put a textdraw over the default time-readout.
That way you can set the time to sunset to make it dark, while you display the time when it's not sunset yet.
Reply
#3

Make a script that sets daylight at TIME. Make this TIME change depending on winter/summer time.


You could use

https://sampwiki.blast.hk/wiki/Getdate

To calculate the TIME variable.

+Rep if I helped you
Reply
#4

And how I can make TIME change depending winter/summer time? Because in San Andreas is summer daylight.
I need some algorithms to make this.
Reply
#5

Quote:
Originally Posted by bogdyutzu
Посмотреть сообщение
And how I can make TIME change depending winter/summer time? Because in San Andreas is summer daylight.
I need some algorithms to make this.
Well, for example, you could do it like this (purely example, idk the real light times xD)

Get the date and determine if it's winter or summer with https://sampwiki.blast.hk/wiki/Getdate
|
v
Every hour check what time it is with https://sampwiki.blast.hk/wiki/Gettime
|
v
if it's winter and it's 7 pm -> make it nighttime
if it's summer and it's 9 pm -> make it nighttime

That is assuming you want your to have weather according to the real world time.
Reply
#6

I want that daylight change smoothly.
This is what I tried:

PHP код:
GetWinterSummerDay(&hour)
{
    new 
        
__y
        
__m
        
__d;
    
    
getdate(__y__m__d);
    
hour += (<= __m <= 6) ? (6-__m) : (__m-6);
    return 
true;

Every month night increases or decreases with 1 hour. So I add to current time some hours depending on month.
But the problem is that morning light is wrong.
Reply
#7

Any idea?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)