[Include] w!hook - (beta)
#9

Finalmente, o cуdigo ficaria assim:

pawn Код:
#define string:
#define TYPES:%0) _:TYPE_N:TYPE_M:##%0,,)
#define TYPE_N:TYPE_M:##,,) "")
#define TYPE_M:##%2,%3) TYPE_0:TYPE_1:TYPE_E:##|||%2|||%3)
#define TYPE_0:TYPE_1:TYPE_E:#%0#%1|||%2[]|||%3,%4) TYPE_0a:TYPE_0b:#%0#%1|||%2|||%3,%4)
#define TYPE_0a:TYPE_0b:#%0#%1|||string:%2|||%3,%4) TYPE_0:TYPE_1:TYPE_E:#%0s#%1,%2|||%3|||%4)
#define TYPE_0b:#%0#%1|||%2|||%3,%4,%5) TYPE_0:TYPE_1:TYPE_E:#%0ai#%1,%2,%3|||%4|||%5)
#define TYPE_1:TYPE_E:#%0#%1|||%2|||%3,%4) TYPE_1a:TYPE_1b:#%0#%1|||%2|||%3,%4)
#define TYPE_1a:TYPE_1b:#%0#%1|||%6:%2|||%3,%4) TYPE_0:TYPE_1:TYPE_E:#%0i#%1,_:%2|||%3|||%4)
#define TYPE_1b:#%0#%1|||%2|||%3,%4) TYPE_0:TYPE_1:TYPE_E:#%0i#%1,%2|||%3|||%4)
#define TYPE_E:#%0#%1||||||%3) #%0#%1)

#define fp%0(%1) %0(%1); public %0(%1)
#define hookfunc%1(%2)  fp %1__(%2)

hookfunc func1(bru) {
    printf("teste [A] %d [A]", bru);
    return true;
}


hookfunc func2(str[]) {
    printf("teste [B] %s [A]", str);
    return true;
}


#define stock%1(%2) \
            fp %1(%2) return CallLocalFunction(#%1#__, TYPES:%2), CallLocalFunction(#%1#_hooked, TYPES:%2); fp %1_hooked(%2)



stock func1(bru)
{
    printf("teste [A] %d [B]", bru);
    return true;
}

stock func2(string:str[]) // para strings necessita string:
{
    printf("teste [B] %s [B]", str);
    return true;
}


stock bruno() {
    return true;
}

Problemas

O usuбrio precisaria colocar string:

Nгo poderiam usar ... nas callbacks abaixo (elipse)
Reply


Messages In This Thread
w!hook - (beta) - by WLSF - 08.10.2013, 20:20
Re: w!hook - (beta) - by ipsBruno - 08.10.2013, 20:25
Re: w!hook - (beta) - by PT - 08.10.2013, 20:36
Re: w!hook - (beta) - by ipsBruno - 08.10.2013, 20:38
Re: w!hook - (beta) - by ipsBruno - 08.10.2013, 20:42
Re: w!hook - (beta) - by shittt - 08.10.2013, 20:50
Re: w!hook - (beta) - by ipsBruno - 08.10.2013, 21:10
Re: w!hook - (beta) - by Juniiro3 - 08.10.2013, 21:11
Re: w!hook - (beta) - by ipsBruno - 08.10.2013, 21:15
Re: w!hook - (beta) - by TheKoDaK - 08.10.2013, 21:33
Re: w!hook - (beta) - by Falcon. - 08.10.2013, 21:38
Re: w!hook - (beta) - by smiiir - 08.10.2013, 21:40
Re: w!hook - (beta) - by WLSF - 08.10.2013, 21:47
Re: w!hook - (beta) - by Juniiro3 - 08.10.2013, 21:49
Re: w!hook - (beta) - by WLSF - 08.10.2013, 21:51
Re: w!hook - (beta) - by Juniiro3 - 08.10.2013, 22:19
Re: w!hook - (beta) - by AlieN_. - 08.10.2013, 22:20
Re: w!hook - (beta) - by Juniiro3 - 08.10.2013, 22:24
Re: w!hook - (beta) - by AlieN_. - 08.10.2013, 23:43
Re : w!hook - (beta) - by ipsBruno - 13.10.2013, 10:05
Re: w!hook - (beta) - by WLSF - 13.10.2013, 11:40
Respuesta: w!hook - (beta) - by DanDRT - 13.10.2013, 11:44
Re: w!hook - (beta) - by PT - 13.10.2013, 12:06

Forum Jump:


Users browsing this thread: 2 Guest(s)