SA-MP Forums Archive
How to detect the luminosity level ? - 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: How to detect the luminosity level ? (/showthread.php?tid=345219)



How to detect the luminosity level ? - C0b0ll - 24.05.2012

Hello everyone,

Do you know if it is possible to detect the luminosity level at a specific point (or for a player) ?
GTA SA detects that (when a car is in the dark, the lights are switched on automatically), but is it possible with samp ?


Tanks a lot


Re: How to detect the luminosity level ? - iggy1 - 24.05.2012

Not that i know of.

But you could implement your own function using GetPlayerTime quite easily. Also if you set the weather you would need to take that into account.

You would need to look how dark it is (once per in-game hour) and make your own luminosity rating, it's doable.
IIRC the darkness only changes on the hour. (may be wrong about that)


Re: How to detect the luminosity level ? - C0b0ll - 24.05.2012

Hi,

Tanks for your reply.

In fact, I want to detect if a player is in the shadow (of a bridge, in the subway, ...). I don't want to know the global luminosity of a weather.

I can develop workaround (specify dark zones manually), but I try to find a better way.


++


Re: How to detect the luminosity level ? - C0b0ll - 24.05.2012

An idea ?


Re: How to detect the luminosity level ? - Mandrakke - 24.05.2012

There are no functions to detect it.


Re: How to detect the luminosity level ? - MP2 - 24.05.2012

You mean when the player icon on the radar turns blue? Not possible.


Re: How to detect the luminosity level ? - spedico - 24.05.2012

Quote:
Originally Posted by C0b0ll
Посмотреть сообщение
Hi,

Tanks for your reply.

In fact, I want to detect if a player is in the shadow (of a bridge, in the subway, ...). I don't want to know the global luminosity of a weather.

I can develop workaround (specify dark zones manually), but I try to find a better way.


++
There's no better way than getting all the dark zones. And even that would require too much work IMO, if you want it to be perfect.


AW: How to detect the luminosity level ? - EnzoMortelli - 24.05.2012

+Using Shadow enhancing mods like enb or colormod on client side will have those players be hidden not only in the specified zones, but also in dark shadows outside.
This could result in dumb modders wondering why the things you want to do with hidden players don't work when they are actually hidden.
So they will spam you with bug-reports at 4am in the morning, and you'll wake up and get out of the bed to check the messages, stumble over your shoes and fall on the edge of your desk with your head and die.
So... better not implement it :3


Re: How to detect the luminosity level ? - SuperViper - 24.05.2012

Weather 2 allows sirens at any day time. I'm not sure about car lights but it should probably allow them.


Re: How to detect the luminosity level ? - qinaixiuor - 24.05.2012

I don't want to know the global luminosity of a weather.