For passing id and a string to the called function:
PHP Code:
public test( id )
{
new szString[] = "Hello there";
set_task( 1.0 , "YourFunction" , id , szString , sizeof( szString ) );
}
public YourFunction( szString[] , id )
{
client_print( id , print_chat , "%s" , szString );
}
To pass id and however many integers. Be careful when using this method because if you try to access a non-existant array element in your called function you will get garbage data. Example, if you tried to access iData[ 22 ] in YourFunction(); 17408 was returned in my test.
PHP Code:
public test( id )
{
new iIntegers[ 3 ];
iIntegers[ 0 ] = 55;
iIntegers[ 1 ] = 11;
iIntegers[ 2 ] = 1232;
set_task( 1.0 , "YourFunction" , id , iIntegers , sizeof( iIntegers ) );
}
public YourFunction( iData[] , id )
{
client_print( id , print_chat , "%d %d %d" , iData[ 0 ] , iData[ 1 ] , iData[ 2 ] );
}
__________________