/*
*
* Filterscript Loading System
* by dante @ LTU
* Motive: Godfather's Vehicle id mess-up
*
* You MUST #define FILTERSCRIPT_COUNT to the number of FS's in filterscripts.cfg
*/
forward LoadFS();
forward split(const strsrc[], strdest[][], delimiter);
public LoadFS()
{
new arrCoords[FILTERSCRIPT_COUNT][64];
new strFromFile2[64];
new s[98];
new File: file = fopen("filterscripts.cfg", io_read);
if (file)
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
for(new i = 0; i < FILTERSCRIPT_COUNT; i++)
{
format(s, 32, "loadfs %s", arrCoords[i]);
SendRconCommand(s);
}
}
fclose(file);
return 1;
}
public split(const strsrc[], strdest[][], delimiter)
{
new i, li;
new aNum;
new len;
while(i <= strlen(strsrc)){
if(strsrc[i]==delimiter || i==strlen(strsrc)){
len = strmid(strdest[aNum], strsrc, li, i, 128);
strdest[aNum][len] = 0;
li = i+1;
aNum++;
}
i++;
}
return 1;
}