11.03.2012, 15:09
Wrote an example, similar to RyDeR` code
pawn Код:
public OnFilterScriptInit() {
CallLocalFunction("MiscFunc", "ii", 1, 2); // to init CallLocalFunction
CallLocalFunctionEx("MyFunc", "iiiii", 1, 2, 3, 4, 5);
}
pawn Код:
stock CallLocalFunctionEx(const func[], const form[], {Float, _}: ...) {
new
args = ((numargs() - 2) << 2),
addr,
i
;
#emit addr.pri form
#emit stor.s.pri addr
for(i = (addr + args), args += 8; addr != i; i -= 4) {
#emit load.s.pri i
#emit load.i
#emit push.pri
}
#emit push.s form
#emit push.s func
#emit push.s args
#emit sysreq.c CallLocalFunction
}
pawn Код:
forward MyFunc(v1, v2, v3, v4, v5);
public MyFunc(v1, v2, v3, v4, v5) {
printf("%d %d %d %d %d", v1, v2, v3, v4, v5);
}