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

[Any] Immunity4Replay: Replay and SourceTV bot immunity and renaming


Post New Thread Reply   
 
Thread Tools Display Modes
Author
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Plugin ID:
2351
Plugin Version:
sm_i4r_version
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Give your Replay/SourceTV bot immunity to prevent it from being kicked. Plugin can also be used to auto-rename your bot.
    Unapprover:
    Reason for Unapproving:
    Plugin features now duplicated by cvars built-into the game
    Old 05-22-2011 , 03:56   [Any] Immunity4Replay: Replay and SourceTV bot immunity and renaming
    Reply With Quote #1

    [Any] Immunity4Replay
    Version 3.4.2



    Description:
    Two features:
    • Immunity: Give your replay bot immunity to prevent admins from interacting with it (kicking/banning/etc).
    • Renaming: Give your replay bot a custom name!

    Commands:
    • -None-

    Cvars:
    • sm_i4r_enable
      • Default: "1"
      • Enable/Disable the plugin
    • sm_i4r_replay_name
      • Default: "replay"
      • The name to rename the Replay bot to (leave as "replay" for no change).
    • sm_i4r_sourcetv_name
      • Default: "sourcetv"
      • The name to rename the SourceTV bot to (leave as "sourcetv" for no change).
    You can set the above cvars in the ReplayImmunity.cfg file that is automatically created.


    Install Instructions:
    1. Drag and drop.

    Notes:
    The plugin will attempt to detect bots if it is late-loaded.
    For best results the plugin should be loaded at startup.

    Developers:
    In case you want an easy way to get the clientid of each bot:

    Code:
     
    
    /** * Returns the Replay bot's client ID * * @return ClientID if known, -1 if the bot is unavailable */ native bool:I4R_GetReplayClientID(); /** * Returns the SourceTV bot's client ID * * @return ClientID if known, -1 if the bot is unavailable */ native I4R_GetSourceTVClientID();




    Version History:
    • V1.0.0
      • Initial Release
    • V2.0.0
      • Large portion of the plugin rewritten in order to better detect the bot.
      • Plugin should now work as intended.
    • V2.0.1
      • Fixed an error caused if the bot connected after OnConfigsExecuted.
    • V3.1.0 - Thanks to psychonic for examples!
      • Rewrote most of the plugin.
      • Plugin now supports SourceTV, and because of that will be useful for games other then TF2.
      • Plugin now sets immunity before configs are read, so immunity levels are no longer configurable (this was pointless anyway).
      • Plugin now creates/uses ReplayImmunity.cfg.
      • Fixed a bug that broke names with spaces.
      • The plugin will now attempt to detect bots if it is late-loaded, but this may fail if the bots do not have their default names.
        For best results, load the plugin at server startup.
    • 3.2.0
      • Added I4R_GetReplayClientID and I4R_GetSourceTVClientID natives.
    • V3.2.1
      • Added a check to prevent errors if the plugin is late-loaded when the map changes.
    • V3.2.2
      • Fixed the plugin not re-detecting bots after a map change
    • V3.3.3
      • Fixed another case where the plugin would not re-detect bots after a map change. (Hopefully this is fixed for real this time).
    • V3.4.0- Thanks bl4nk for catch + fix!
      • Fixes some stuff I goofed up in OnPluginStart.
    • V3.4.1
      • Quick fix so this plugin doesn't break other plugins using OnClientPostAdminCheck.
    • V3.4.2
      • Now handles renaming locally

    Total downloads as prior to last edit: 293

    Not writing a plugin? Then you don't need the inc file!
    Attached Files
    File Type: inc Immunity4Replay.inc (704 Bytes, 243 views)
    File Type: sp Get Plugin or Get Source (Immunity4Replay.sp - 686 views - 5.9 KB)
    __________________

    Last edited by Peace-Maker; 03-26-2012 at 15:54.
    DarthNinja is offline
    Thraka
    AlliedModders Donor
    Join Date: Aug 2005
    Old 05-23-2011 , 18:37   Re: [TF2] Immunity4Replay: Replay bot immunity and renaming
    Reply With Quote #2

    Cool! Thanks!
    Thraka is offline
    Thraka
    AlliedModders Donor
    Join Date: Aug 2005
    Old 05-24-2011 , 15:49   Re: [TF2] Immunity4Replay: Replay bot immunity and renaming
    Reply With Quote #3

    Hrm, doesn't seem to rename the bot... I have the default settings with a sm_i4r_name set to "Neophytes Replay BOT"
    Thraka is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 05-25-2011 , 00:29   Re: [TF2] Immunity4Replay: Replay bot immunity and renaming
    Reply With Quote #4

    Quote:
    Originally Posted by Thraka View Post
    Hrm, doesn't seem to rename the bot... I have the default settings with a sm_i4r_name set to "Neophytes Replay BOT"
    Yeah, I've found a couple problems with renaming and retaining settings after a map change.

    I'll prolly post a fix later tonight
    __________________
    DarthNinja is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 05-26-2011 , 01:23   Re: [TF2] Immunity4Replay: Replay bot immunity and renaming
    Reply With Quote #5

    Version 2.0 Released:
    The plugin will now apply settings after reading the config, rather then directly when the bot connects.
    This also solves the problem of settings not being re-applied after map changes.

    Setting the sm_i4r_name cvar manually will immediately rename the bot, rather then waiting for the next map load to refresh the settings.

    Hope this solves your problems Thraka
    __________________
    DarthNinja is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 05-28-2011 , 06:55   Re: [TF2] Immunity4Replay: Replay bot immunity and renaming
    Reply With Quote #6

    ~V2.0.1 Released~
    __________________
    DarthNinja is offline
    Thraka
    AlliedModders Donor
    Join Date: Aug 2005
    Old 05-31-2011 , 11:57   Re: [TF2] Immunity4Replay: Replay bot immunity and renaming
    Reply With Quote #7

    Thanks that fixed it. However if the new name of the robot has a SPACE character in it, it stops processing the name at that point: "My Replay Bot" as a name becomes "My"
    Thraka is offline
    Flyflo
    Senior Member
    Join Date: Jun 2008
    Location: Grenoble, France
    Old 05-31-2011 , 12:32   Re: [TF2] Immunity4Replay: Replay bot immunity and renaming
    Reply With Quote #8

    I had the same problem plus this error:
    Code:
    L 05/27/2011 - 18:03:17: [SM] Native "SetUserAdmin" reported: Client index 0 is invalid
    L 05/27/2011 - 18:03:17: [SM] Displaying call stack trace for plugin "Immunity4Replay.smx":
    L 05/27/2011 - 18:03:17: [SM]   [0]  Line 37, /home/groups/alliedmodders/forums/files/4/9/8/6/5/86641.attach::SetBotImmunity()
    L 05/27/2011 - 18:03:17: [SM]   [1]  Line 73, /home/groups/alliedmodders/forums/files/4/9/8/6/5/86641.attach::OnConfigsExecuted()
    I modified the plugin a little to fix both errors.
    Attached Files
    File Type: sp Get Plugin or Get Source (Immunity4Replay.sp - 613 views - 2.2 KB)
    __________________
    Flyflo is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 05-31-2011 , 23:14   Re: [TF2] Immunity4Replay: Replay and SourceTV bot immunity and renaming
    Reply With Quote #9

    Update Released:

    Quote:
    • V3.1.0 - Thanks to psychonic for examples!
      • Rewrote most of the plugin.
      • Plugin now supports SourceTV, and because of that will be useful for games other then TF2.
      • Plugin now sets immunity before configs are read, so immunity levels are no longer configurable (this was pointless anyway).
      • Plugin now creates/uses ReplayImmunity.cfg.
      • Fixed a bug that broke names with spaces.
      • The plugin will now attempt to detect bots if it is late-loaded, but this may fail if the bots do not have their default names.
        For best results, load the plugin at server startup.
    This should all currently reported problems.
    __________________
    DarthNinja is offline
    Thraka
    AlliedModders Donor
    Join Date: Aug 2005
    Old 06-01-2011 , 13:34   Re: [TF2] Immunity4Replay: Replay and SourceTV bot immunity and renaming
    Reply With Quote #10

    Failed to load after a map change. I checked and the replay bot is set to player #2 for some reason

    Code:
             # userid name uniqueid connected ping loss state adr
             # 2 "replay" BOT active
    Code:
    L 06/01/2011 - 10:27:45: Info (map "cp_coldfront") (file "errors_20110601.log")
    L 06/01/2011 - 10:27:45: [SM] Native "IsFakeClient" reported: Client 1 is not connected
    L 06/01/2011 - 10:27:45: [SM] Displaying call stack trace for plugin "Custom\Immunity4Replay.smx":
    L 06/01/2011 - 10:27:45: [SM]   [0]  Line 60, /home/groups/alliedmodders/forums/files/4/9/8/6/5/86894.attach::OnPluginStart()
    Once I restarted the server, it loaded ok with the bot at #2. I don't know why it didn't previously.
    Thraka 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 14:09.


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