About calling natives from C
#1

Well, I found out that Peter's Invoke snippet is not very efficient in speed, so I tried around with stuff like this

pawn Код:
typedef bool (*IsPlayerConnected_t)(int);
IsPlayerConnected_t pIsPlayerConnected = (IsPlayerConnected_t)0x4637E0;
bool IsPlayerConnected(int iPlayerID) { return pIsPlayerConnected(iPlayerID); }
This already works so far, but note I've made a seperate function for it since it seems to crash when I use pIsPlayerConnected directly (not quite sure why, but have an idea)
Also, my disassembly knowlege isn't good enough to see why this doesn't work for all functions (such as these that need more arguments), I was already guessing the parameter
could be an AMX cell* but this also failed.

So, if any of you is experienced enough to explain it, I will appreciate it
Reply


Messages In This Thread
About calling natives from C - by Streetplaya - 01.12.2009, 17:02
Re: About calling natives from C - by Google63 - 01.12.2009, 17:29
Re: About calling natives from C - by Streetplaya - 01.12.2009, 17:35
Re: About calling natives from C - by Google63 - 01.12.2009, 17:46
Re: About calling natives from C - by Streetplaya - 01.12.2009, 18:11
Re: About calling natives from C - by Google63 - 01.12.2009, 18:39
Re: About calling natives from C - by Streetplaya - 02.12.2009, 12:18
Re: About calling natives from C - by Toribio - 02.12.2009, 16:56
Re: About calling natives from C - by Incognito - 02.12.2009, 17:31
Re: About calling natives from C - by Streetplaya - 02.12.2009, 17:42

Forum Jump:


Users browsing this thread: 4 Guest(s)