07.07.2011, 21:55
(
Last edited by Kyosaur; 07/07/2011 at 10:26 PM.
)
Quote:
Ok, I tried a couple of things to make this working.
But it didnt work out. So I found out I didn't ask the right question, so once again. How can I juse Natives (such as GetPlayerPos) inside my DLL? I tried things like: amx_FindNative to get the address. and this to 'compare'. Hope someone can help me out. |
Thats how you correctly set it up. To get it working you have to call the memeber function getAddresses (i suggest on GM load), and you have to add your own natives (it currently only contains object related natives). You add the native's names to the list of names in invoke.h, and you fill the Native structure for it right below that (try to follow the pattern of the ones already there if you dont know what your doing). Once thats done, simply add a call to the native function in a public PAWN function (one thats not for use...this function should contain a call for every function you add to invoke... the functions have to be used in a public in order to get their addresses.).
Edit:
Im gonna upload my current one, it has more natives (converted them from peters' old PawnCommand), and uses it uses standard maps. You still have to set it up for yourself though (gotta allocate memory, push the amx_list back, and delete an item from amx_list when AmxUnload is called).
Here' the PAWN function containing all the defined natives (You'd want to add this in an include. I personally have it in my PAWN GM, as my real GM is a plugin):
http://pastebin.com/7d9yzwPg
Here's the invoke script by incognito:
http://www.sendspace.com/file/uuwpx1
Note: Make sure every time you add a native (i do it on an as needed basis) you add it to that PAWN function, or you'll get a run-time error.