SA-MP Forums Archive
Checking if a filterscript is running? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Checking if a filterscript is running? (/showthread.php?tid=169205)



Checking if a filterscript is running? - Sky4D - 18.08.2010

How would I go about checking if a filterscript is running? I have this at the moment:

pawn Код:
COMMAND:refresh(playerid, params[])
{
    new firstParam[50], name[50];
    if(playerStats[playerid][Administrator] >= 4)
    {
        if(!sscanf(params, "ss", firstParam, name))
        {
            if(strcmp(firstParam, "filterscript", true) == 0)
            {
                if(FilterScriptIsRunning(name)) //This obviously won't work, but this is where it needs to go.
                {
                    new string[128];
                    format(string, sizeof(string), "reloadfs %s", name);
                    SendRconCommand(string);
                    format(string, sizeof(string), "INFO: %s.amx has been refreshed.", name);
                    SendClientMessage(playerid, sc_Lime, string);
                }
            }
            else { SendClientMessage(playerid, sc_LightRed, "ERROR: Invalid Parameter!"); SendClientMessage(playerid, sc_White, " PARAMETERS: filterscript"); }
        }
        else return SendClientMessage(playerid, sc_White, "COMMAND: /refresh [PARAM1(filterscript)] [Name of Parameter]");
    }
    else return ERROR_01;
    return 1;
}