Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if defined _FSIF_included
- #endinput
- #endif
- #define _FSIF_included
- #include < a_samp >
- stock IT( g_sTr[ ], ySa_File[ ], bool: g_iCase = false, g_Pos = 0 )
- {
- static
- File: gZa_File, i,
- yZs_BLA,
- yS_ReZ
- ;
- gZa_File = fopen( ySa_File, io_read );
- if( g_Pos > 0 ) fseek( gZa_File, g_Pos, seek_current );
- if( g_iCase )
- {
- for( i = 0; g_sTr[ i ]; ++i )
- g_sTr[ i ] = tolower( g_sTr[ i ] );
- for( i = 0, yZs_BLA = 0; ( yS_ReZ = fgetchar( gZa_File, -1, false ) ) != -1; ++i )
- {
- if( tolower( yS_ReZ ) == g_sTr[ yZs_BLA ] )
- {
- yZs_BLA++;
- if( !g_sTr[ yZs_BLA ] ) return fclose( gZa_File ), i - strlen( g_sTr ) + 1 + g_Pos;
- }
- else
- yZs_BLA = 0;
- }
- }
- else
- {
- for ( i = 0, yZs_BLA = 0; ( yS_ReZ = fgetchar( gZa_File, -1, false ) ) != -1; ++i )
- {
- if( ( yS_ReZ ) == g_sTr[ yZs_BLA ] )
- {
- yZs_BLA ++;
- if( !g_sTr[ yZs_BLA ] ) return fclose( gZa_File ), i - strlen( g_sTr ) + 1;
- }
- else yZs_BLA = 0;
- }
- }
- return fclose( gZa_File ), -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment