Hi guys, I'm trying to pass a string and an integer on the same parameter. Was wondering if I've implemented this right.
Edit: If anybody else looking here's how I got it to work.
PHP Code:
native my_native( _value, any:... )
register_native( "my_native", "_my_native", .style = 0 )
public _my_native( iPlugin, iParams )
{
if ( iParams != 2 )
return
static bStringValueList = ( 1 << 1 ) | ( 1 << 2 ) | ( 1 << 3 )
new iValue = get_param( 1 )
new szBuffer[ 32 ]
new iInput
if ( ( 1 << iValue ) & bStringValueList )
{
get_string( 2, szBuffer, charsmax( szBuffer ) )
}
else
{
iInput = get_param_byref( 2 )
}
switch ( iValue )
{
case 1: copy( szMyString1, charsmax( szMyString1 ), szBuffer )
case 2: copy( szMyString2, charsmax( szMyString2 ), szBuffer )
case 3: copy( szMyString3, charsmax( szMyString3 ), szBuffer )
case 4: iVariable1 = iInput
case 5: iVariable2 = iInput
case 6: iVariable3 = iInput
}