My first time using arrays and the server is crashed when loading
Code:
#include < amxmodx >
new Array:aArray;
public plugin_cfg( )
{
aArray = ArrayCreate( 32 );
new iFile = fopen( "addons\maps.ini", "rt" );
new iEndFile = feof( iFile );
while( !iEndFile )
{
new szChar[ 256 ];
fgets( iFile, szChar, sizeof szChar - 1 );
ArrayPushString( aArray, szChar );
}
fclose( iFile );
}
public plugin_init ( )
{
register_clcmd( "say 1", "msg" );
}
public msg( )
{
new szLine[ 256 ];
ArrayGetString( aArray, 1, szLine, sizeof szLine - 1 );
client_print( 0, print_chat, "%s", szLine );
}