Weather, time In a proper place
#1

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

(playerid, -1276.0623, -1338.5737 ,2566.4331 ,2480.5859 )
Reply
#2

Impossible.
Reply
#3

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

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;
}
Reply
#5

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

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

Did it work?
Reply
#8

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

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

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.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)