Efficiency
#6

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
I was thinking this was more efficient (and possibly faster), but just wasn't sure. Thanks! By the way, say I were to put this into an array. How would I use the array as if it were a stock function?
One way:

pawn Код:
new
    bool: g_validskins[ 300 char ]
;

SetValidSkins( 4, 5, 24, 34, 73, 129, 130, 131, 132, 133 134, 159, 161, 162, 182, 191, 196, 197 198, 201, 202 );//gamemodeinit

stock SetValidSkins( ... )
{
    new
        iArgs = numargs( )
    ;
   
    for( new i; i < iArgs; i++ )
    {
        g_validskins{ getarg( i ) } = true;
    }
}

stock bool: IsTruckerSkin( skinid )
{
    if( g_validskins{ skinid } == true ) return true;
    return false;
}
Reply


Messages In This Thread
Efficiency - by Scenario - 17.01.2012, 01:32
Re: Efficiency - by 2KY - 17.01.2012, 01:37
Re: Efficiency - by Lorenc_ - 17.01.2012, 01:46
Re: Efficiency - by 2KY - 17.01.2012, 01:47
Re: Efficiency - by Scenario - 17.01.2012, 01:48
Re: Efficiency - by Lorenc_ - 17.01.2012, 01:56
Re: Efficiency - by -Prodigy- - 17.01.2012, 01:56
Re: Efficiency - by Scenario - 17.01.2012, 02:17
Re: Efficiency - by Kar - 17.01.2012, 02:45
Re: Efficiency - by Scenario - 17.01.2012, 02:50

Forum Jump:


Users browsing this thread: 2 Guest(s)