08.10.2013, 21:15
Finalmente, o cуdigo ficaria assim:
Problemas
O usuбrio precisaria colocar string:
Nгo poderiam usar ... nas callbacks abaixo (elipse)
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)