Posts: 270
Threads: 7
Joined: Apr 2015
For example, I have a function like this:
Код:
forward my_printf(format[], {Float,_}:...)
public my_printf(format[], {Float,_}:...)
{
return printf(format, {Float,_}:...);
}
It errors... How to get each variable, or use them?
Thanks
Posts: 1,208
Threads: 36
Joined: Apr 2015
I found such a hook on printf
You can use it
PHP код:
stock AC_printf(const fmat[], {Float, _}:...) {
static output[128], frm_header[3];
const output_size = sizeof(output);
#emit LCTRL 5
#emit CONST.alt frm_header
#emit MOVS 12
#emit ADD.C 12
#emit SCTRL 4
#emit PUSH.C output_size
#emit PUSH.C output
#emit LOAD.S.pri 8
#emit ADD.C 8
#emit PUSH.pri
#emit SYSREQ.C format
#emit LCTRL 5
#emit SCTRL 4
#emit MOVE.alt
#emit CONST.pri frm_header
#emit MOVS 12
#emit LOAD.S.pri 8
#emit ADD.C 12
#emit MOVE.alt
#emit LCTRL 5
#emit ADD
#emit LOAD.I
#emit STOR.S.pri 20
//your function
static debugmsg[128];
format(debugmsg,128,"DBG: %s",output);
MSGToAdmins(-1, debugmsg, true, LEVEL_ADMIN3);
return print(output);
#pragma unused fmat
}
//hook
#if defined _ALS_printf
#undef printf
#else
#define _ALS_printf
#endif
#define printf AC_printf
I do not understand how it works, but it works: D
Posts: 270
Threads: 7
Joined: Apr 2015
Quote:
Originally Posted by AbyssMorgan
I found such a hook on printf
You can use it
I do not understand how it works, but it works: D
|
No, printf was just an Example...
ANYONE ELSE?
Posts: 270
Threads: 7
Joined: Apr 2015
Quote:
Originally Posted by BroZeus
|
Thanks, I'll look it up.