PDA

View Full Version : Define default function.


budelis
31/10/2012, 09:37 AM
Hi,


I want to define default samp function to my stock, i do that:

#define SetPlayerHealth(%1,%2) SetPlayerHealthEx(%1,%2)

Am right?

Stylock
31/10/2012, 10:41 AM
#define SetPlayerHealth(%1,%2) SetPlayerHealthEx(%1,%2)
That works, but better would be:

#if defined _ALS_SetPlayerHealth
#undef SetPlayerHealth
#else
#define _ALS_SetPlayerHealth
#endif
#define SetPlayerHealth Prefix_SetPlayerHealth
That way your functions won't conflict with other libraries.