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;
}