29.11.2012, 03:37
For example, there is function CallLocalFunction(const function[], const format[], {Float,_}:...), I want to create a function with optional parameters, add prefix to first named variable, and pass them to CallLocalFunction. Let it be - MyFunction(const function[], const format[], {Float,_}:...). At first, it looks like:
but it's not right (doesn't compile) - it's not possible to pass the optional parameters directly. I have read this topic
http://forum.sa-mp.com/showpost.php?...&postcount=150 - but, have no idea how to pass variables. Can some body give the right code?
Код:
MyFunction(const function[], const format[], {Float,_}:...)
{
new func_name[128];
format(func_name, sizeof(func_name), "%s_%s", "prefix", function);
return CallLocalFunction(func_name, format, {Float,_}:...);
}
http://forum.sa-mp.com/showpost.php?...&postcount=150 - but, have no idea how to pass variables. Can some body give the right code?


