How to replace a SAMP native with another...
#1

Hello all...
I have a function called SetPlayerCheckpointEx...

However, Instead of replacing all SetPlayerCheckpoint's in my code, I want to replace the SetPlayerCheckpoint function completely...

How do I do so ?

I tried these though:
pawn Код:
stock SetPlayerCheckpointEx(playerid, Float:x, Float:y, Float:z, Float:size)
{
    AdminCP[playerid][0] = x;
    AdminCP[playerid][1] = y;
    AdminCP[playerid][2] = z;
    return SetPlayerCheckpoint(playerid, x, y, z, size);
}
#if defined SetPlayerCheckpoint
    #undef SetPlayerCheckpoint
    #define SetPlayerCheckpoint SetPlayerCheckpointEx
#else
    #define SetPlayerCheckpoint SetPlayerCheckpointEx
#endif
Reply
#2

Quote:
Originally Posted by [HLF]Southclaw
Посмотреть сообщение
You can find some information about function hooking in this thread: https://sampforum.blast.hk/showthread.php?tid=441293 Scroll to the end for native function hooking. You'll want to do all this right at the top of your code but after the include lines for the functions you want to hook so all future uses will use your version.
Thanks...
I just forgot the _ALS_ part
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)