PDA

View Full Version : Check if something is included


Manyula
21/08/2018, 07:43 PM
Let's say I want to create an include which offers two functions, A and B. Function B, however, requires the streamer to be included. How do I check if the streamer is included?

Lokii
21/08/2018, 09:23 PM
#if !defined _inc_streamer
#include <streamer>
#endif

Spmn
21/08/2018, 10:13 PM
https://github.com/samp-incognito/samp-streamer-plugin/blob/master/streamer.inc#L20
So check if `_streamer_included` is defined.

Zeex compiler doesn't generate include guards by default, so relying on _inc_* symbols might not give accurate results.

Manyula
22/08/2018, 09:50 AM
So, I just put the check inside the functions that require the streamer instead of on top of the script, correct? Thank you!