29.12.2017, 16:00
There are some functions in amx_assembly for that. They aren't perfect, since it is not possible to always get a function's name, but if it is a public then there's no problem.
You can wrap that in a function, but it gets more complex, because those functions depend on their location in the stack:
However, I'm not 100% sure if that will even work. There are three types of address - relative, absolute, and resolved. Relative addresses are things like "jump 4 bytes forward", absolute addresses are "jump to code at pawn address 128", resolved addresses are "jump to code at real memory address 0x40248238". I don't know which of those "GetPublicNameFromAddress" takes, and which of those "GetFrameFunction" returns - they might not be compatible by default, but there are various conversion functions about.
PHP код:
new dest[32];
GetPublicNameFromAddress(GetCurrentFrameFunction(), dest);
PHP код:
GetCurrentFrameFunctionName()
{
new name[32];
GetPublicNameFromAddress(GetFrameFunction(GetCurrentFramePreviousFrame()), name);
return name;
}