01.12.2009, 17:29
Well here how It's done in Assembly( i tested with random and worked ):
If you have more then 1 param then push it in reverse order( that's how stack works )
If you have any problem, tell...
EDIT:
NOTE: C++ standard says that return value from function must always be in "eax", I dont think C standard says same... but SAMP is written in C++ so you dont have to worry :P
Код:
typedef unsigned long DWORD; bool vm_IsPlayerConnected(int playerid) { DWORD ADDR_IsPlayerConnected = 0x4637E0; bool value = false; _asm { push playerid call ADDR_IsPlayerConnected mov value, eax } return value; }
If you have any problem, tell...
EDIT:
NOTE: C++ standard says that return value from function must always be in "eax", I dont think C standard says same... but SAMP is written in C++ so you dont have to worry :P