Raised This Month: $214 Target: $400
 53% 

[ANY] Timing Out Announce v1.0.3 (28.10.2012)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Plugin ID:
3068
Plugin Version:
1.0.3
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Announce everyone that player is timing out.
    Old 07-08-2012 , 05:29   [ANY] Timing Out Announce v1.0.3 (28.10.2012)
    Reply With Quote #1

    WHAT_IS_THIS_WHAT_IS_HAPPENING
    Announce everyone that player is timing out.
    How it look like?
    Known bugs?
    * Render effects may work incorrectly; same for god mode.
    CVars:
    PHP Code:
    sm_toa_version
    sm_toa_enabled 1 
    // enable/disable plugin
    sm_toa_renderfx 0 // change renderfx when timing out
    sm_toa_godmode 0 
    Changelogs:
    Code:
    28.10.2012: 
        Version: 1.0.3:
            * Some code changes 
            * Added sm_toa_godmode
    02.08.2012: 
        Version: 1.0.2:
            * Once client is back (when RenderFx is enabled) RenderFx sets to that it was before timing out (what)
    11.07.2012: 
        Version: 1.0.1:
            * Fixed '%username% is back!' message on connect
    08.07.2012: 
        Version: 1.0.0:
            * Initial release
    Attached Files
    File Type: sp Get Plugin or Get Source (timingout.sp - 782 views - 4.9 KB)
    __________________

    Last edited by Leonardo; 02-07-2014 at 18:46.
    Leonardo is offline
    Chanz
    Veteran Member
    Join Date: Aug 2008
    Location: Germany - Stuttgart
    Old 08-02-2012 , 11:42   Re: [ANY] Timing Out Announce v1.0.1 (11.07.2012)
    Reply With Quote #2

    Hi,
    nice plugin so far, but...
    1. Does it really need to be checked in OnGameFrame, isn't a timer every second enough?
    2. Your plugin clears all other render effects when someone is timing out, may lead to incompatibility with other plugins/mods? But I guess that can be ignored as long no one reports anything about it.
    3. Also you may want to change the following:
    This:
    PHP Code:
    public OnConVarChanged(Handle:hConVar, const String:strOldValue[], const String:strNewValue[] )
    {
        
    OnConfigsExecuted();

    To this:
    PHP Code:
    public OnConVarChanged_Enabled(Handle:convar, const String:oldValue[], const String:newValue[])
    {
        
    bEnabled StringToInt(newValue);
    }
    public 
    OnConVarChanged_RenderFx(Handle:convar, const String:oldValue[], const String:newValue[])
    {
        
    bRenderFx StringToInt(newValue);

    Maybe some additional ideas:
    • Remove players from the game like teleport them or moving to spectator.
    • Make players completely invisible.
    • God mode for players.
    • Sounds? Like a beacon that a player emits?
    • Kill players that are timing out (to prevent glitches with alt+tab)?
    • Respawn a player, because he is killed anyways (unless he is the last player alive in the team).
    Keep it up!

    Cya,
    Chanz
    __________________
    [ SourceModPlugins.org ][ My Plugins ]

    Thank you for donations: [ Paypal ]

    Video Tutorial (German): [ Gameserver & SourceMod Plugins mit HLSW verwalten ]
    Chanz is offline
    Leonardo
    Veteran Member
    Join Date: Feb 2010
    Location: 90's
    Old 08-02-2012 , 12:10   Re: [ANY] Timing Out Announce v1.0.1 (11.07.2012)
    Reply With Quote #3

    Quote:
    Originally Posted by Chanz View Post
    1/ Does it really need to be checked in OnGameFrame, isn't a timer every second enough?
    y
    Quote:
    Originally Posted by Chanz View Post
    2/ Your plugin clears all other render effects when someone is timing out, may lead to incompatibility with other plugins/mods? But I guess that can be ignored as long no one reports anything about it.
    I through about that. Maybe with version 1.0.2 it'll be fixed. But there's no game-, event-specific checking functions
    Quote:
    Originally Posted by Chanz View Post
    3/ Also you may want to change the following:

    This:
    PHP Code:
    public OnConVarChanged(Handle:hConVar, const String:strOldValue[], const String:strNewValue[] )
    {
        
    OnConfigsExecuted();

    To this:
    PHP Code:
    public OnConVarChanged_Enabled(Handle:convar, const String:oldValue[], const String:newValue[])
    {
        
    bEnabled StringToInt(newValue);
    }
    public 
    OnConVarChanged_RenderFx(Handle:convar, const String:oldValue[], const String:newValue[])
    {
        
    bRenderFx StringToInt(newValue);

    Why?

    Quote:
    Originally Posted by Chanz View Post
    Maybe some additional ideas:
    • Remove players from the game like teleport them or moving to spectator.
    • Make players completely invisible.
    • God mode for players.
    • Sounds? Like a beacon that a player emits?
    • Kill players that are timing out (to prevent glitches with alt+tab)?
    • Respawn a player, because he is killed anyways (unless he is the last player alive in the team).
    • No.
    • No. You still can see him/her/it with HUD element "TargetID"
    • Maybe. But what if player has god mode already enabled?
    • No.
    • No. (What glitches? TF2's glitch was fixed, for example)
    • No. (How he would be killed if he's invincible?)
    __________________

    Last edited by Leonardo; 08-08-2012 at 07:36.
    Leonardo is offline
    thetwistedpanda
    Good Little Panda
    Join Date: Sep 2008
    Old 08-02-2012 , 13:53   Re: [ANY] Timing Out Announce v1.0.1 (11.07.2012)
    Reply With Quote #4

    If it's possible to do something outside of OnGameFrame, do it outside of OnGameFrame. For this plugin, a repeating timer every 0.1-1.0 seconds for each player would easily suffice as compared to a loop of x players 66x a second.
    __________________

    Last edited by thetwistedpanda; 08-02-2012 at 13:53.
    thetwistedpanda is offline
    Leonardo
    Veteran Member
    Join Date: Feb 2010
    Location: 90's
    Old 08-02-2012 , 14:12   Re: [ANY] Timing Out Announce v1.0.1 (11.07.2012)
    Reply With Quote #5

    it itakes 2-3 seconds for engine to understand that client is timing out
    but I must know when client has stopped responding immediately! ON EACH FRAME
    Leonardo is offline
    thetwistedpanda
    Good Little Panda
    Join Date: Sep 2008
    Old 08-02-2012 , 14:15   Re: [ANY] Timing Out Announce v1.0.1 (11.07.2012)
    Reply With Quote #6

    If there's a two to three second delay, a check every 0.1 seconds will suffice. There's no reason to know every frame. Especially when all you're doing is messing with their render.
    __________________

    Last edited by thetwistedpanda; 08-02-2012 at 14:16.
    thetwistedpanda is offline
    eric0279
    AlliedModders Donor
    Join Date: May 2007
    Old 08-07-2012 , 23:00   Re: [ANY] Timing Out Announce v1.0.2 (02.08.2012)
    Reply With Quote #7

    Hello,

    Code:
    static bool:bTimedOut[MAXPLAYERS+1], RenderFx:iRenderFx[MAXPLAYERS+1];;
    should be :
    Code:
    static bool:bTimedOut[MAXPLAYERS+1], RenderFx:iRenderFx[MAXPLAYERS+1];
    eric0279 is offline
    Leonardo
    Veteran Member
    Join Date: Feb 2010
    Location: 90's
    Old 08-08-2012 , 03:06   Re: [ANY] Timing Out Announce v1.0.2 (02.08.2012)
    Reply With Quote #8

    ... why this thing marked as error? :\
    Leonardo is offline
    Chanz
    Veteran Member
    Join Date: Aug 2008
    Location: Germany - Stuttgart
    Old 08-08-2012 , 07:30   Re: [ANY] Timing Out Announce v1.0.2 (02.08.2012)
    Reply With Quote #9

    The splitting of the OnConVarChanged functions, is better to read and more logical.
    You want others to understand your code, also have a clear structure to track bugs.
    Since this plugin ain't that big its not a problem, but continuing this style leads to a plugin that noone wants to read/understand, which is necessary if you'd like to see your plugin approved.
    Just think about it. ;-)

    The additional ideas I mentioned, sure make no sense when used all together.
    I thought about using them separated with cvar switches as you did it with the render.
    __________________
    [ SourceModPlugins.org ][ My Plugins ]

    Thank you for donations: [ Paypal ]

    Video Tutorial (German): [ Gameserver & SourceMod Plugins mit HLSW verwalten ]

    Last edited by Chanz; 08-08-2012 at 07:38.
    Chanz is offline
    Dr. McKay
    Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
    Join Date: Aug 2011
    Location: Atlantis
    Old 08-17-2012 , 12:29   Re: [ANY] Timing Out Announce v1.0.2 (02.08.2012)
    Reply With Quote #10

    I don't see any reason to break apart cvar hooks. It's not that expensive to reload all cvars when one is changed, and it honestly makes it more readable in my opinion.
    __________________
    Dr. McKay is offline
    Reply


    Thread Tools
    Display Modes

    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 12:14.


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