30.03.2013, 14:24
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++;
}
}