Will this work and reload the FS?
#1

pawn Код:
new string[128], reload[128];
GetServerVarAsString("filterscripts", string, sizeof string);
format(reload, sizeof reload, "reloadfs %s", string);
SendRconCommand(reload);
Reply
#2

Yes, that will work with no problems.
Reply
#3

Not sure if it would work with more than one filterscript.
Reply
#4

Quote:
Originally Posted by Joe Torran C
pawn Код:
new string[128], reload[128];
GetServerVarAsString("filterscripts", string, sizeof string);
format(reload, sizeof reload, "reloadfs %s", string);
SendRconCommand(reload);
pawn Код:
/*
     substr_count - FreddoX/Calgon
     explode - Westie's strlib
*/


stock substr_count( substring[], string[] )
{
    new tmpcount;
  for( new i = 0; i < strlen( string ); i++)
  {
        if( strfind( string[ i ], substring, true ) )
        {
          tmpcount++;
        }
  }
  return tmpcount;
}

stock explode(aExplode[][], const sSource[], const sDelimiter[] = " ", iVertices = sizeof aExplode, iLength = sizeof aExplode[])
{
    new
        iNode,
        iPointer,
        iPrevious = -1,
        iDelimiter = strlen(sDelimiter);

    while(iNode < iVertices)
    {
        iPointer = strfind(sSource, sDelimiter, false, iPointer);

        if(iPointer == -1)
        {
            strmid(aExplode[iNode], sSource, iPrevious, strlen(sSource), iLength);
            break;
        }
        else
        {
            strmid(aExplode[iNode], sSource, iPrevious, iPointer, iLength);
        }

        iPrevious = (iPointer += iDelimiter);
        ++iNode;
    }

    return iPrevious;
}

stock ReloadFSthing()
{
    new
        string[ 128 ],
        substr_counts;
       
    GetServerVarAsString( "filterscripts", string, sizeof( string ) );
   
    substr_counts = substr_count( " ", string );
   
    new
      filterscripts_array[ substr_counts ][ 10 ]; // Ensure all FS names are less than 10 characters.print
     
    explode( filterscripts_array, string, " " );
   
    return 1;
}
Untested, but something LIKE that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)