18.05.2010, 06:09
pawn Код:
new string[128], reload[128];
GetServerVarAsString("filterscripts", string, sizeof string);
format(reload, sizeof reload, "reloadfs %s", string);
SendRconCommand(reload);
new string[128], reload[128];
GetServerVarAsString("filterscripts", string, sizeof string);
format(reload, sizeof reload, "reloadfs %s", string);
SendRconCommand(reload);
Originally Posted by Joe Torran C
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;
}