SA-MP Forums Archive
How to Undef a function that use native? - 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 Undef a function that use native? (/showthread.php?tid=437580)



How to Undef a function that use native? - yxliang - 16.05.2013

How to Undef a function that use native?


Re: How to Undef a function that use native? - zombieking - 16.05.2013

What?


Re: How to Undef a function that use native? - SilverKiller - 16.05.2013

#undef

e.g :

pawn Код:
#undef SetPlayerPos
I'm not sure as i didn't test it before, but give it a try..


Re: How to Undef a function that use native? - jordy.kiesebrink - 16.05.2013

On top you need to

pawn Код:
#define SOMETHING
pawn Код:
#if defined SOMETHING
// do this if its defined
#endif
pawn Код:
#if defined SOMETHING
// use this if it is defined
#else
// not defined, it will do this
#endif
pawn Код:
#if !defined SOMETHING
// not defined, it will do this
#endif



Re: How to Undef a function that use native? - SilverKiller - 16.05.2013

Quote:
Originally Posted by jordy.kiesebrink
Посмотреть сообщение
pawn Код:
#if defined SOMETHING
// do this if its defined
#endif
pawn Код:
#if defined SOMETHING
// use this if it is defined
#else
// not defined, it will do this
#endif
He wants to undefine it, not to check if it is defined or not..

Код:
This forum requires that you wait 120 seconds between posts. Please try again in 65 seconds.



Re: How to Undef a function that use native? - Lordzy - 16.05.2013

pawn Код:
#undef <native>
Undefines the native you specifies. If you're trying to HOOK it, use _ALS_ method of hooking or y_hooks.


Re: How to Undef a function that use native? - yxliang - 17.05.2013

Quote:
Originally Posted by ******
Посмотреть сообщение
Just delete it, but why would you need to remove a native? It still exists.
I am trying to make a hook for native function as it isn't a callback so It can't use y_hooks and _ALS_ I think it can't work.


Re: How to Undef a function that use native? - yxliang - 17.05.2013

Quote:
Originally Posted by SilverKiller
Посмотреть сообщение
#undef

e.g :

pawn Код:
#undef SetPlayerPos
I'm not sure as i didn't test it before, but give it a try..
I tried and I doesn't work.


Re: How to Undef a function that use native? - yxliang - 17.05.2013

Quote:
Originally Posted by ******
Посмотреть сообщение
Sure it can use ALS!
Oh! I see. ****** could you give me your skype or some irc's account name in order to discuss some technological topic.


Re: How to Undef a function that use native? - yxliang - 18.05.2013

Quote:
Originally Posted by ******
Посмотреть сообщение
Sure it can use ALS!
I used _ALS_ to hook but there are warnings warning 201: redefinition of constant/macro (symbol "SetPlayerHealth")
warning 201: redefinition of constant/macro (symbol "SetPlayerArmour")

But only two function's hook have warning, why?