I want to make a simple hook through the #emit
I've tried using codes like SendClientMessageEx or EasyDialog, but I need it to return the value
If possible comment the code so I can study it
PHP Code:
native CallLocalFunction(const funcname[], const format[], {Float,_}:...);
native printf(const output[], {Float,_}:...);
stock __CallLocalFunction(const funcname[], const format[], {Float,_}:...) {
static retval;
if(funcidx(funcname) == -1) {
retval = 0;
printf("Function not defined: %s.\n", funcname);
} else {
if(numargs() == 2) {
retval = CallLocalFunction(funcname, format);
} else {
// "emit" code to call function with args and return value to "retval"
}
}
return retval;
}
If possible comment the code so I can study it