Get number of loaded filterscripts
#1

Hi^^

Is it possible to get the number of loaded filterscripts? I thought I could count it with GetServerVarAsString but this won't work because only the first filterscript shows up :/
Reply
#2

I guess you could count the ones that are loaded in-game. I'm not sure how you would do it otherwise.

I guess you could do something like this within a script:

pawn Код:
//Global Var
new TotalFS;

//Function
stock LoadFS(name[])
{
     new str[64];
     format(str, sizeof(str), "loadfs %s", name);
     SendRconCommand(str);
     TotalFS++;
}

//Usage: LoadFS(filterscript name); - FUNCTION

//Get total players - although you could just request the variable data, if you wanted something logical, use:

stock GetTotalFilterscripts() return TotalFS;

//Or use a macro?

#define GetTotalFilterscripts() TotalFS
I guess you could do that?
Reply
#3

Well, this would require changing any script. I need something which can count number of scripts anytime in one script without changing any other scripts.
Reply
#4

I don't think that is possible, although an idea is, but it doesn't fit your needs, to use ******'s callback hook to OnFilterScriptInit (If it works with FS'es?)
Reply
#5

Maybe this or this? I'm not sure
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)