Help me with 1 code
#1

Hi.I want when the time in game is 18:00 in the game to get dark and when the time becomes 6:00 in game to get bright.Sorry but my english sux...

My code to here:

pawn Код:
forward WeatherTime();
public WeatherTime()
{
    gettime(hour, minute);
    if( hour == 18 )
    {
        SetWorldTime(9);
    }
    else if( hour == 19)
    {
        SetWorldTime(10);
    }
}
Reply
#2

bump .. please help
Reply
#3

Read this topic, may help you !
https://sampforum.blast.hk/showthread.php?tid=154482
Reply
#4

here's my time code:
pawn Код:
new hour, minute;

stock UpdateWorldWeather()
{
    new next_weather_prob = random(100);
    if(next_weather_prob < 70)      SetWeather(fine_weather_ids[random(sizeof(fine_weather_ids))]);
    else if(next_weather_prob < 95) SetWeather(foggy_weather_ids[random(sizeof(foggy_weather_ids))]);
    else                            SetWeather(wet_weather_ids[random(sizeof(wet_weather_ids))]);
}

public UpdateTimeAndWeather()
{
    gettime(hour, minute);

    format(timestr,32,"%02d:%02d",hour,minute);
    TextDrawSetString(txtTimeDisp,timestr);
    SetWorldTime(hour);

        new x=0;
    while(x!=MAX_PLAYERS) {
        if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) {
            SetPlayerTime(x,hour,minute);
         }
         x++;
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)