Raised This Month: $ Target: $400
 0% 

in_array(); => pawn


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-25-2009 , 21:25   Re: in_array(); => pawn
Reply With Quote #3

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "bugsy"

new iArray[] = { 23 55 56 122 }
new 
szArray[] = { "hello" "world" "amxmodx" }

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    if ( 
InArray23 iArray sizeof iArray ) )
        
server_print("found it integer" )
    else
        
server_print("not found integer" );
        
    if ( 
InArrayString"world" szArray ) )
        
server_print("found it string" )
    else
        
server_print("not found string" );
}

//Integer
public InArray( const iValue , const iArray[] , const iArraySize )
{
    for ( new 
<  iArraySize i++ )
        if ( 
iValue == iArray[i] )
            return 
1;

    return 
0;
}

//String
public InArrayString( const szValue[] , const szArray[] , const iArraySize )
{
    for ( new 
iArraySize i++ )
        if ( 
equaliszValue szArray[i] ) )
            return 
1;
    
    return 
0;

__________________

Last edited by Bugsy; 05-25-2009 at 21:30.
Bugsy is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode