alliedmodders / sourcemod

SourceMod - Source Engine Scripting and Administration
http://www.sourcemod.net/
990 stars 425 forks source link

SM Version 1.11 - build 6968 - sm_kick @spec #2194

Open Trice1984 opened 4 months ago

Trice1984 commented 4 months ago

Hello everybody,

my SM Version 1.11 - build 6968 my MM Version v1.11.0-dev+1155V.

We have a Linux Server ( Ubuntu 22.04.4 LTS). We run CSS Server, now, when we will kick all spec, sm_kick @spec, they kick not all specs, we diabled Plugin ... but it is a bug in SM Version?

Does anyone else have these problems? We will find nothing in Forums and so one....

Kind regards

Mooshua commented 4 months ago

So, sm_kick will only kick players you are allowed to kick. Are you trying to kick other admins or something like that?

Also, it would be really helpful if you could provide any reproduction or more details. Does this happen with specific players or can it be reproduced every time with a list of steps?

Trice1984 commented 4 months ago

Hello, thank you for the answer, the Root Admin permission is set, but it doesn't work for kick normal players either. If 10 people are spectators, he kicks 4 or 7 but never ALL of them, but most often the same players remain without rights to the spectator.

peace-maker commented 4 months ago

I'm assuming those players aren't in the spectator team but still in the "unassigned" team. The @spec target filter apparently doesn't treat them the same. There are plugins which add an @unassigend too.

Trice1984 commented 4 months ago

Hello, thanks for the answer, do you have an example for @unassigend kick? I only found this https://forums.alliedmods.net/showthread.php?t=59646?t=59646......... Maybe there are better ones?

Trice1984 commented 4 months ago

Standard is use:
sm_kick @unassigend [SM] No matching client was found.

But 3 people where there and not kicked by use: sm_kick @spec :-(

ambaca commented 3 months ago

Standard is use: sm_kick @unassigend [SM] No matching client was found.

But 3 people where there and not kicked by use: sm_kick @SPEC :-(

Compile this SM plugin code and load on your server. Admins who have granted "sm_kick" can use targeting @unassigned. This admin access can be override to else, using override word "target_unassigned_players".


public void OnPluginStart()
{
    AddMultiTargetFilter("@unassigned", filter, "unassigned players", false);
}

public bool filter(const char[] pattern, ArrayList clients, int client)
{

    RequireFeature(FeatureType_Capability, FEATURECAP_MULTITARGETFILTER_CLIENTPARAM, "Plugin multitargetfilter require: ", FEATURECAP_MULTITARGETFILTER_CLIENTPARAM);

    if(client && !CheckCommandAccess(client, "target_unassigned_players", ADMFLAG_KICK))
    {
        ReplyToCommand(client, "[SM] You have no access to target @unassigned players");
        return false;
    }

    for(int i = 1; i <= MaxClients; i++)
    {
        if(!IsClientInGame(i) || GetClientTeam(i) != 0) continue;

        clients.Push(i);
    }

    return true;
}

Usage: sm_kick @unassigned works

*updated, thanks to peace-maker for pointing typos

peace-maker commented 3 months ago

*unassigned whoops 😄