18.03.2018, 15:13
I need a function which counts loaded filterscripts. Is there any way to check if filterscript loads/unloads successfully?
OnFilterScriptInit doesn't get called in gamemode.
GetConsoleVarAsString doesn't work as it should.
Also I don't want to do something like this:
Gamemode:
Every filterscript:
Any other ideas? Thanks in advance.
OnFilterScriptInit doesn't get called in gamemode.
GetConsoleVarAsString doesn't work as it should.
Also I don't want to do something like this:
Gamemode:
Код:
new gLoadedFilterscripsCount; forward IncreaseLoadedFilterscriptCount(); public IncreaseLoadedFilterscriptCount() gLoadedFilterscripsCount += 1; forward DecreaseLoadedFilterscriptCount(); public DecreaseLoadedFilterscriptCount() gLoadedFilterscripsCount -= 1; forward GetLoadedFilterscriptsCount(); public GetLoadedFilterscriptsCount() return gLoadedFilterscripsCount;
Код:
public OnFilterScriptInit()
{
CallRemoteFunction("IncreaseLoadedFilterscriptCount", "");
return 1;
}
public OnFilterScriptExit()
{
CallRemoteFunction("DecreaseLoadedFilterscriptCount", "");
return 1;
}


