09.08.2011, 05:26
It's untested, and I doubt it'll work, but it's worth a try. Make sure to change the 10 that declares the array and the number inside the sscanf line to what you'd want the max kicks to be.
The problem I'm worried about is sscanf isn't going to allow parsing those extra values, in case you don't type them all, and just give an error and abort the operation. If my thinking is correct, this will not work. However, like I said, it's worth a shot.
The problem I'm worried about is sscanf isn't going to allow parsing those extra values, in case you don't type them all, and just give an error and abort the operation. If my thinking is correct, this will not work. However, like I said, it's worth a shot.
pawn Code:
COMMAND:kicks( playerid, params[ ] )
{
if( !IsPlayerAdmin( playerid ) ) return 0;
new kicks[ 10 ] = { -1, ... };
sscanf( params, "a<i>[10]", kicks );
for( new i = 0; i < sizeof( kicks ); i++ )
{
if( kicks[ i ] != -1 )
{
KickPlayer( kicks[ i ] );
}
}
return 1;
}