Define default function.
#1

Hi,


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

Code:
#define SetPlayerHealth(%1,%2) SetPlayerHealthEx(%1,%2)
Am right?
Reply
#2

Quote:
Originally Posted by budelis
View Post
Code:
#define SetPlayerHealth(%1,%2) SetPlayerHealthEx(%1,%2)
That works, but better would be:

pawn Code:
#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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)