SA-MP Forums Archive
Weather affects interior - 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: Weather affects interior (/showthread.php?tid=376546)



Weather affects interior - sim_sima - 10.09.2012

Hi guys. I have created a house with some of the new SA-MP objects. It is a walk-in interior, where you don't get teleported when you enter the house.
It is pretty cool, but I have a problem with the weather. When it rains/sandstorm, it is also inside the house. (Look at attached screenshots).
Is there any way to fix this?

Hope you can help. Thank you.


Re: Weather affects interior - HuSs3n - 10.09.2012

you can check if the player is inside the house and use SetPlayerWeather


Re: Weather affects interior - sim_sima - 11.09.2012

Quote:
Originally Posted by HuSs3n
Посмотреть сообщение
you can check if the player is inside the house and use SetPlayerWeather
Yea, I also thought of that, but how can I detect exactely if he is inside or outside?
When someone enters that house, they dont get teleported, it is just walk straight in.


Re: Weather affects interior - zT KiNgKoNg - 11.09.2012

you can't since its an object


Re: Weather affects interior - [DOG]irinel1996 - 11.09.2012

It's possible, give a try to Incognito's streamer plugin. It has nice features about areas, even in 3D. I could do that with it.


Re: Weather affects interior - sim_sima - 12.09.2012

Quote:
Originally Posted by irinel1996
Посмотреть сообщение
It's possible, give a try to Incognito's streamer plugin. It has nice features about areas, even in 3D. I could do that with it.
How exactely?


Respuesta: Weather affects interior - Siralos - 12.09.2012

housearea = CreateDynamicRectangle (Around the house)
Then, OnPlayerEnterDynamicArea...
If areaid == housearea...
SetPlayerWeather(playerid, 0)


Re: Respuesta: Weather affects interior - sim_sima - 12.09.2012

Quote:
Originally Posted by Siralos
Посмотреть сообщение
housearea = CreateDynamicRectangle (Around the house)
Then, OnPlayerEnterDynamicArea...
If areaid == housearea...
SetPlayerWeather(playerid, 0)
Yes, but how do I make it to be exactely around the house?


Respuesta: Weather affects interior - Siralos - 12.09.2012

Well, just take x,y coordinates with /save and create the dynamic rectangle accordingly...


Re: Weather affects interior - MarkoN - 12.09.2012

There is a function to check if a player is in interior IsPlayerInAnyInterior
https://sampwiki.blast.hk/wiki/Useful_Fu...rInAnyInterior
ex.
pawn Код:
if(IsPlayerInAnyInterior(playerid))
{
SetPlayerWeather(playerid, 1);
}
EDIT:
ups . didn't see that its a custom made map.
just use https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint and change the weather