Thanks Exolent, pardon my typo, I just got in from playing horse-shoes and drinking beer.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "bugsy"
new iArray[] = { 1 , 23 , 55 , 56 , 122 }
new szArray[][] = { "hello" , "world" , "amxmodx" }
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
if ( InArray( 23 , iArray , sizeof iArray ) )
server_print("found it integer" )
else
server_print("not found integer" );
if ( InArrayString( "world" , szArray , sizeof szArray ) )
server_print("found it string" )
else
server_print("not found string" );
}
//Integer
public InArray( const iValue , const iArray[] , const iArraySize )
{
for ( new i = 0 ; i < iArraySize ; i++ )
if ( iValue == iArray[i] )
return 1;
return 0;
}
//String
public InArrayString( const szValue[] , const szArray[][] , const iArraySize )
{
for ( new i = 0 ; i < iArraySize ; i++ )
if ( equali( szValue , szArray[i] ) )
return 1;
return 0;
}
@stupok
Code:
Warning: Indeterminate array size in "sizeof" expression (symbol "") on line 19
found it integer
not found string
__________________