SA-MP Forums Archive
Weather, time In a proper place - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Weather, time In a proper place (/showthread.php?tid=75611)



Weather, time In a proper place - Zeleniy - 03.05.2009

Hello.
How to make weather, time, In this square ?

(playerid, -1276.0623, -1338.5737 ,2566.4331 ,2480.5859 )


Re: Weather, time In a proper place - MenaceX^ - 03.05.2009

Impossible.


Re: Weather, time In a proper place - Djiango - 03.05.2009

SetPlayerWeather, SetPlayerTime & IsPlayerInArea. Or wouldn't that work?


Re: Weather, time In a proper place - Gappy - 03.05.2009

Use a timer and use
pawn Код:
IsPlayerInArea(playerid, -1276.0623, -1338.5737, 2566.4331, 2480.5859)
So it would be kinda like

pawn Код:
forward WeatherTime(playerid);

public WeatherTime(playerid)
{
   if(IsPlayerInArea(playerid, -1276.0623, -1338.5737, 2566.4331, 2480.5859))
   {
     SetPlayerWeather(playerid, weatherid);
     SetPlayerTime(playerid, hour, minute);
   }
   else
   {
     SetPlayerWeather(playerid, weatherid);
     SetPlayerTime(playerid, hour, minute);
   }
   return 1;
}
and under OnGameModeInIt add
pawn Код:
SetTimer("WeatherTime", 200, true);
and you would need this for IsPlayerInArea
pawn Код:
forward IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy);

IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    if (x > minx && x < maxx && y > miny && y < maxy) return 1;
    return 0;
}



Re: Weather, time In a proper place - Zeleniy - 03.05.2009

Quote:
Originally Posted by |∞|-Рцппσĵσ-|∞|
SetPlayerWeather, SetPlayerTime & IsPlayerInArea. Or wouldn't that work?
If to do so, Weather, time Remains with the player.


Re: Weather, time In a proper place - Zeleniy - 03.05.2009

Quote:
Originally Posted by MenaceX^
Impossible.
I personally saw


Re: Weather, time In a proper place - Gappy - 03.05.2009

Did it work?


Re: Weather, time In a proper place - pen_theGun - 03.05.2009

Quote:
Originally Posted by MenaceX
Impossible.
Eh....tstststs

\/ \/
http://forum.sa-mp.com/index.php?top...28.0;topicseen


Re: Weather, time In a proper place - HB - 03.05.2009

Quote:
Originally Posted by Gappy
pawn Код:
else
   {
     SetPlayerWeather(playerid, weatherid);
     SetPlayerTime(playerid, hour, minute);
   }
That actually sets the weather if he isn't in that area, so that means he isn't able to set other weathers in the script because of that function. Imo the "else" should be left away, so you can also set another weather.


Re: Weather, time In a proper place - Gappy - 03.05.2009

Quote:
Originally Posted by иєσz
Quote:
Originally Posted by Gappy
pawn Код:
else
   {
     SetPlayerWeather(playerid, weatherid);
     SetPlayerTime(playerid, hour, minute);
   }
That actually sets the weather if he isn't in that area, so that means he isn't able to set other weathers in the script because of that function. Imo the "else" should be left away, so you can also set another weather.
But if you leave it out, once you enter that area where it changes your weather, you will still have that weather when you live the area.

The else is to set you back to the original time and weather for when you leave the area