SA-MP Forums Archive
How to pass undefined number of argument to another function - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to pass undefined number of argument to another function (/showthread.php?tid=413222)



How to pass undefined number of argument to another function - xX_Simon_Xx - 04.02.2013

PHP Code:
//somewere func(10,"hello",0.14)
stock func({Float_}:...)
{
     
//do someting
      
func2(); // HOW i can pass {Float, _}:... to this function???
}
stock func2({Float_}:...)
{
    
//do something else;




Re: How to pass undefined number of argument to another function - LarzI - 04.02.2013

https://sampforum.blast.hk/showthread.php?tid=399069


Re: How to pass undefined number of argument to another function - xX_Simon_Xx - 04.02.2013

Whitout YSI
i need to use emit right?
PHP Code:
stock mysql_function_queryEx(connectionHandlequery[], bool:cachecallback[], format[], {Float,_}:...)
{
      
//something
      
return mysql_function_query(connectionHandlequerycachecallbackformat//var);

or i can use the #define version whitout emit ??
Quote:

or i can use the #define version whitout emit ??

PHP Code:
#define mysql_function_queryEx(%0,%1,%2,%3,%5,%6) \
//sometig \
 
return mysql_function_query(%0,%1,%2,%3,%5,%6); 



Re: How to pass undefined number of argument to another function - InfiniTy. - 04.02.2013

https://sampforum.blast.hk/showthread.php?tid=77000


Re: How to pass undefined number of argument to another function - xX_Simon_Xx - 04.02.2013

Quote:
Originally Posted by Adytza.
View Post
This has nothing to do with my question

I want to know how to do without using the #define


Re: How to pass undefined number of argument to another function - iggy1 - 04.02.2013

https://sampforum.blast.hk/showthread.php?tid=77000

Use the functions getarg and numargs. No define.


Re: How to pass undefined number of argument to another function - xX_Simon_Xx - 04.02.2013

Quote:
Originally Posted by iggy1
View Post
https://sampforum.blast.hk/showthread.php?tid=77000

Use the functions getarg and numargs. No define.
numargs return a simply integer number that rappresent the number of the argument
getarg return only one argument
It's unuseful for pass all argument

I need to pass an undefined number argument to another function not to read it
The easyest way is whit #define but i want to know how can do it whit #emit or if is another simple way


Re: How to pass undefined number of argument to another function - T0pAz - 04.02.2013

Quote:
Originally Posted by xX_Simon_Xx
View Post
numargs return a simply integer number that rappresent the number of the argument
getarg return only one argument
It's unuseful for pass all argument

I need to pass an undefined number argument to another function not to read it
The easyest way is whit #define but i want to know how can do it whit #emit or if is another simple way
Use y_va then.


Re: How to pass undefined number of argument to another function - xX_Simon_Xx - 05.02.2013

Quote:
Originally Posted by Y_Less
View Post
Why?
simply to understand how it's done


Re: How to pass undefined number of argument to another function - xX_Simon_Xx - 05.02.2013

can you link me the post?