Help me with 1 code - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me with 1 code (
/showthread.php?tid=426843)
Help me with 1 code -
MrTinder - 30.03.2013
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);
}
}
Re: Help me with 1 code -
MrTinder - 30.03.2013
bump .. please help
Re: Help me with 1 code -
RajatPawar - 30.03.2013
Read this topic, may help you !
https://sampforum.blast.hk/showthread.php?tid=154482
Re: Help me with 1 code -
MrTinder - 30.03.2013
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++;
}
}