ReDefining native functions
#2

Quote:
Originally Posted by Calix
This seems to compile fine (haven't yet had time to test), but was wondering if this is valid to do. Basically, instead of making a whole new function, I thought, why not just redefine the current one so it is still compatible with my script. I've seen it done with callbacks, but have yet to see it done with native functions.

pawn Код:
#define IsPlayerAdmin Stock_IsPlayerAdmin
#define My_IsPlayerAdmin IsPlayerAdmin
stock My_IsPlayerAdmin(playerid) return (PlayerInfo[playerid][pAdmin] > 0 || CallLocalFunction("Stock_IsPlayerAdmin", "i", playerid));
forward Stock_IsPlayerAdmin(playerid);
This way it checks if they are an admin according to the script, or if they are logged into RCON.
You don't forward stocks and next time try it before posting, really a waste of thread space.
Reply


Messages In This Thread
ReDefining native functions - by Calix - 16.09.2009, 21:29
Re: ReDefining native functions - by Norn - 16.09.2009, 21:34
Re: ReDefining native functions - by Calix - 16.09.2009, 21:43

Forum Jump:


Users browsing this thread: 1 Guest(s)