Raised This Month: $51 Target: $400
 12% 

WTSR: Woody's Tree Spectator Restriction


Post New Thread Reply   
 
Thread Tools Display Modes
Author
W00DY
Junior Member
Join Date: Apr 2008
Location: ZZ9 Plural Z Alpha
Plugin ID:
816
Plugin Version:
1.00
Plugin Category:
Admin Commands
Plugin Game:
Half-Life 2 Deathmatch
Plugin Dependencies:
    Servers with this Plugin:
    18 
    Plugin Description:
    Restricts access to the spectator mode and allows to swap others to and from spectator mode.
    Old 03-29-2009 , 16:05   WTSR: Woody's Tree Spectator Restriction
    Reply With Quote #1

    Code:
    This plugin restricts access to the console commands 'spectate' and
    'jointeam' to admins with the permission to execute a given command. The idea
    is, that only admins with the appropriate permissions are allowed to
    spectate.
    This plugin targets HL2DM, because MoggieX's 'Reserved Spectators/Teams'
    plugin does not work with it.
    
    Console commands:
    -    spectate:
            affected as described above
    -    jointeam <1|2>:
            affected as described above
    
    CVARs:
    -    wtsr_version:
            the plugin's version.
    -    wtsr_admflags:
            a string of ASCII character admin flags (like "c" for "kick") that
            determines who can bypass the restriction.
            (default: "d", i.e. "ban")
    
    Testing platform:
    -    Linux SRCDS 1.0.0.19
    -    Metamod:Source 1.8.5
    -    SourceMod 1.3.6
    
    Changelog:
    -    1.00
        -    changed cvar '_admcmd' to '_admgflags', i.e. now checking against
            flags
        -    removed cvar '_enable'
        -    clean up
        -    renamed to WTSR
    -    0.82
        -    refurbishment
        -    added suppression of team switch messages
    -     0.815
        -    general redesign
        -    renamed CVARs
        -    added 'AutoExecConfig()'
        -    added translation support (translations: en, de)
        -    workaround for 'colour problem' with Mästerkatten's 'Spawn & Chat
            Protection'
    -     0.42
        -    Initial release
    Attached Files
    File Type: sp Get Plugin or Get Source (wtsr.sp - 1389 views - 4.6 KB)
    File Type: txt wtsr.phrases.txt (263 Bytes, 489 views)

    Last edited by W00DY; 02-27-2011 at 10:21. Reason: first "real" release & rename
    W00DY is offline
    nbtc971
    Senior Member
    Join Date: Sep 2008
    Old 06-17-2009 , 09:49   Re: [HL2DM] Spectator Restriction
    Reply With Quote #2

    This might be causing a couple of my servers to repeatedly restart over and over.. still investigating.
    nbtc971 is offline
    DJ Tsunami
    DJ Post Spammer
    Join Date: Feb 2008
    Location: The Netherlands
    Old 06-17-2009 , 10:59   Re: [HL2DM] Spectator Restriction
    Reply With Quote #3

    There's nothing in this plugin that could cause a restart though.

    @W00DY: could you edit your post and fill in specrestrict_version as the public cvar?
    __________________
    Advertisements | REST in Pawn - HTTP client for JSON REST APIs
    Please do not PM me with questions. Post in the plugin thread.
    DJ Tsunami is offline
    W00DY
    Junior Member
    Join Date: Apr 2008
    Location: ZZ9 Plural Z Alpha
    Old 06-19-2009 , 12:01   Re: [HL2DM] Spectator Restriction
    Reply With Quote #4

    @ nbtc971: The plugin is running on my Woody's Tree server without any problems so far. To find out the reason for your crashes, I need to now more about your config: addons, plugins, ...
    I for instance have problems matching your description when using BAILOPANs Stripper:Source Metamod-Plugin.

    @ DJ Tsunami: Edits O.K.? Could this become my first and so far only approved plugin?
    W00DY is offline
    nbtc971
    Senior Member
    Join Date: Sep 2008
    Old 06-19-2009 , 21:47   Re: [HL2DM] Spectator Restriction
    Reply With Quote #5

    It must of been a network issue that just happen to start around the time I tested. I just put it back in and it seems fine. thanks.
    nbtc971 is offline
    nbtc971
    Senior Member
    Join Date: Sep 2008
    Old 06-21-2009 , 13:22   Re: [HL2DM] Spectator Restriction
    Reply With Quote #6

    Those with sm_admin can't use it. I made sure they could get the menu too, but no luck. My settings:

    specrestrict_command "sm_admin"
    specrestrict_enable "1"

    I am running keepers but followed your hint.

    In addition your cvar is wrong above it says specrestrict_command and it is suppose to be specrestrict_admcmd however neither work. It appears as though it only registers the default setting of sm_ban.

    *UPDATE*
    Now I tried getting into the source code and changing the default from sm_ban to sm_admin and it still wouldn't work. Keeps saying I don't have access. I'm on 1.2.0 and 1.7.1

    140:02 [SM] Listing 44 plugins:
    01 "Basic Comm Control" (1.2.0) by AlliedModders LLC
    02 "Sound Commands" (1.2.0) by AlliedModders LLC
    03 "Custom Votes" (0.5.6) by chundo
    04 "Name Changer" (1.3) by bl4nk
    05 "Client Preferences" (1.2.0) by AlliedModders LLC
    06 "Simple Teleport" (1.1) by Taco
    07 "Spray Tracer" (5.5a) by Nican132, CptMoore, Lebson506th
    08 "Basic Info Triggers" (1.2.0) by AlliedModders LLC
    09 "SourceBans" (1.3.5) by InterWave Studios Development Team
    10 "Anti-Flood" (1.2.0) by AlliedModders LLC
    11 "SM File/Folder Downloader and Precacher" (1.4) by SWAT_88
    12 "IRC Relay - Base Commands" (2.1.0) by Olly
    13 "Admin Menu" (1.2.0) by AlliedModders LLC
    14 "TeamSwitch" (1.3) by MistaGee
    15 "Basic Chat" (1.2.0) by AlliedModders LLC
    16 "IRC Relay - Bacon" (2.1.0) by Olly
    17 "Admin File Reader" (1.2.0) by AlliedModders LLC
    18 "IRC Relay - Game Info Module" (2.1.0) by Olly
    19 "Auto Name Changer" (3.0) by MoggieX
    20 "IRC Relay - Relay Module" (2.1.0) by Olly
    21 "IRC Relay - Chat Relay Module" (2.1.0) by Olly
    22 "IRC Relay - Auth Module" (2.1.0) by Olly
    23 "Suppress Messages" (1.0.3) by FlyingMongoose
    24 "Fun Commands X" (1.0) by Spazman0 and Arg!
    25 "AFK Manager" (2.5k-compat) by Rothgar
    26 "IRC Relay - Core Plugin" (2.1.0) by Olly
    27 "IRC Relay - Game Players" (2.1.0) by Olly
    28 "Fun Commands" (1.2.0) by AlliedModders LLC
    29 "Player Commands" (1.2.0) by AlliedModders LLC
    30 "Killer info display" (0.9) by Berni
    31 "IRC Relay - Steam Community" (2.1.0) by Olly
    32 "Weapon Logging" (2.6) by TTS Oetzel & Goerz GmbH
    33 "HLstatsX Plugin" (2.6) by TTS Oetzel & Goerz GmbH
    34 "Quake Sounds" (1. by dalto
    35 "Reserved Slots" (1.2.0) by AlliedModders LLC
    36 "IRC Relay - Access Module" (2.0.0) by Olly
    37 "Simple Teleport" (1.1) by Taco
    38 "[HL2DM] Spectator Restriction" (0.815) by Woody
    39 "IRC Relay - Admin Commands Module" (2.1.0) by Olly
    40 "Admin Help" (1.2.0) by AlliedModders LLC
    41 "Basic Commands" (1.2.0) by AlliedModders LLC
    42 "Tag Protection" (1.2) by InstantDeath
    43 "Command Blocker" (1.0) by pRED*
    44 "Nextmap" (1.2.0) by AlliedModders LLC

    I have fixed my plugin for the time being by replacing this:

    Code:
    bool:hasPermission(client) {
        new String:command[64];
        GetConVarString(g_cvarAdmCmd, command, 64);
        if (CheckCommandAccess(client, command, ADMFLAG_ROOT)) {
            return true;
        } else {
            return false;
        }
    }


    with this:

    Code:
    bool:hasPermission(client) {
        new String:command[64];
        GetConVarString(g_cvarAdmCmd, command, 64);
        if ((GetUserFlagBits(client) & ADMFLAG_GENERIC) == ADMFLAG_GENERIC) {
            return true;
        } else {
            return false;
        }
    }
    Yeah I hardcoded it but since I don't know PAWN this was the best I could do. Works for me and how I want to use it.

    Last edited by nbtc971; 06-21-2009 at 16:21.
    nbtc971 is offline
    W00DY
    Junior Member
    Join Date: Apr 2008
    Location: ZZ9 Plural Z Alpha
    Old 06-24-2009 , 05:24   Re: [HL2DM] Spectator Restriction
    Reply With Quote #7

    @ nbtc971: Thx, I corrected the CVAR name in the post. Furthermore I'm going to check, why it does not work with admcmd set to "sm_admin"...!?
    W00DY is offline
    W00DY
    Junior Member
    Join Date: Apr 2008
    Location: ZZ9 Plural Z Alpha
    Old 06-26-2009 , 10:22   Re: [HL2DM] Spectator Restriction
    Reply With Quote #8

    Please find the new 'refurbished' minor version 0.82 attached to the first post.

    @ nbtc971: With v0.82 I tested admcmd set to 'sm_admin' and me having different roles: worked perfectly well for me! Are you sure that v0.815 did work at all, even with the default 'sm_ban'? I found a little 'feature' resulting from the disorganization of my HD...
    W00DY is offline
    toString
    Senior Member
    Join Date: Jun 2009
    Old 06-29-2009 , 08:41   Re: [HL2DM] Spectator Restriction
    Reply With Quote #9

    Hello there, do you know if this works for TF2 as well? I've been looking about and I'm surprised to not see something for disabling spec. Let alone stopping people from chosing teams (to avoid stacking).

    Unless I'm not looking in the right place?!
    toString is offline
    W00DY
    Junior Member
    Join Date: Apr 2008
    Location: ZZ9 Plural Z Alpha
    Old 06-29-2009 , 12:14   Re: [HL2DM] Spectator Restriction
    Reply With Quote #10

    @toString: Hm, I cannot answer your question, because my knowledge about TF2 converges towards zero! You could just try...
    What are the TF2 console commands to spectate or to join a team? If these commands are the same as in HL2DM, namely 'spectate' and 'jointeam', then the plugin should work for TF2 - with slight modifications maybe.
    W00DY is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 17:38.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode