View Single Post
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 03-31-2004 , 12:21  
Reply With Quote #16

i don't really understand you so i'll make an example

plugin1
Code:
// other code (plugin_init etc)... public the_function(paramint, &paramintref, paramstr[]) {    log_amx("the_function called. paramint = %d, paramintref = %d, paramstr = %s", paramint, paramintref, paramstr);    paramintref++;    paramstr[0] = '[';    return 100; } // other code...

plugin2
Code:
// in a function new intVar = 8; new strVar[] = "(:" log_amx("Will call the_function in plugin1.amx; the int param is 4, the intrf Param is 8, the str param is ^"(:^""); callfunc_begin("the_function", "plugin1.amx"); callfunc_push_int(4); callfunc_push_intrf(intVar); callfunc_push_str(strVar); new retVal = callfunc_end(); log_amx("Called it. Return value: %d; the int var is %d and the str var is %s", retVal, intVar, strVar);

The output should be:
Code:
Will call the_function in plugin1.amx; the int param is 4, the intrf Param is 8, the str param is "(:"

the_function called. paramint = 4, paramintref = 8, paramstr = (:

Called it. Return value: 100; the int var is 9 and the str var is [:
Not tested tho
__________________
hello, i am pm
PM is offline