How to add arguments to format?
#9

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);
}
Reply


Messages In This Thread
How to add arguments to format? - by TheGamer! - 11.03.2012, 11:26
Re: How to add arguments to format? - by MP2 - 11.03.2012, 11:32
Re: How to add arguments to format? - by TheGamer! - 11.03.2012, 11:36
Re: How to add arguments to format? - by Twisted_Insane - 11.03.2012, 11:38
Re: How to add arguments to format? - by TheGamer! - 11.03.2012, 11:39
Re: How to add arguments to format? - by MP2 - 11.03.2012, 13:10
Re: How to add arguments to format? - by TheGamer! - 11.03.2012, 13:29
Re: How to add arguments to format? - by Gh05t_ - 11.03.2012, 13:31
AW: How to add arguments to format? - by Nero_3D - 11.03.2012, 15:09

Forum Jump:


Users browsing this thread: 2 Guest(s)