Raised This Month: $32 Target: $400
 8% 

Remember Spectators v1.2.5


Post New Thread Reply   
 
Thread Tools Display Modes
Author
bman87
Senior Member
Join Date: Dec 2008
Location: Michigan
Plugin ID:
1104
Plugin Version:
1.2.5
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    2 
    Plugin Description:
    Remembers who was spectator when the map changes, and moves that player to the spectator team when next map loads
    Old 08-19-2009 , 17:41   Remember Spectators v1.2.5
    Reply With Quote #1

    *Only tested in L4D*

    This will remember who is on the spectator team when the map changes. Once the new maps loads it will move the players back into the spectator team.

    CVAR: remember_spec_version

    Version 1.0.0: Initial Release
    Version 1.1.0: Minor bug fixing (validating clients). Thanks olj!
    Version 1.1.1: Stupid bugs... hopefully fixed validation..
    Version 1.2.0: Added a check when player changes teams
    Version 1.2.1: Forgot to add client validation again...
    Version 1.2.2: Testing Version...
    Version 1.2.3: More minor bug fixes
    Version 1.2.4: Smashing tiny bugs
    Version 1.2.5: Bug fix.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d_spec_remember.sp - 2689 views - 2.8 KB)

    Last edited by berni; 09-12-2009 at 15:36.
    bman87 is offline
    Visual77
    Veteran Member
    Join Date: Jan 2009
    Old 08-19-2009 , 19:16   Re: [L4D] Remember Spectators
    Reply With Quote #2

    Nice work, bman.

    I always had the problem when a player would go spectate right about the time the map would change. It would force the player to join the infected or the survivor team while still being afk, thus ruining the game for everyone. This will save me a lot of trouble. Thanks.

    Btw, got some error logs.

    Code:
    L 08/20/2009 - 00:01:39: SourceMod error session started
    L 08/20/2009 - 00:01:39: Info (map "l4d_vs_hospital01_apartment") (file "errors_20090820.log")
    L 08/20/2009 - 00:01:39: [SM] Native "GetClientTeam" reported: Client 6 is not in game
    L 08/20/2009 - 00:01:39: [SM] Displaying call stack trace for plugin "l4d_spec_remember.smx":
    L 08/20/2009 - 00:01:39: [SM] [0] Line 38, /home/groups/alliedmodders/forums/files/4/4/5/7/4/47874.attach::Event_RoundEnd()
    L 08/20/2009 - 00:01:55: [SM] Native "GetClientTeam" reported: Client 6 is not in game
    L 08/20/2009 - 00:01:55: [SM] Displaying call stack trace for plugin "l4d_spec_remember.smx":
    L 08/20/2009 - 00:01:55: [SM] [0] Line 38, /home/groups/alliedmodders/forums/files/4/4/5/7/4/47874.attach::Event_RoundEnd()
    L 08/20/2009 - 00:02:00: [SM] Native "GetClientTeam" reported: Client 3 is not in game
    L 08/20/2009 - 00:02:00: [SM] Displaying call stack trace for plugin "l4d_spec_remember.smx":
    L 08/20/2009 - 00:02:00: [SM] [0] Line 38, /home/groups/alliedmodders/forums/files/4/4/5/7/4/47874.attach::Event_RoundEnd()
    L 08/20/2009 - 00:02:15: [SM] Native "GetClientTeam" reported: Client 3 is not in game
    L 08/20/2009 - 00:02:15: [SM] Displaying call stack trace for plugin "l4d_spec_remember.smx":
    L 08/20/2009 - 00:02:15: [SM] [0] Line 38, /home/groups/alliedmodders/forums/files/4/4/5/7/4/47874.attach::Event_RoundEnd()
    L 08/20/2009 - 00:02:53: Error log file session closed.

    Last edited by Visual77; 08-19-2009 at 19:23.
    Visual77 is offline
    olj
    Veteran Member
    Join Date: Jun 2009
    Old 08-19-2009 , 19:30   Re: [L4D] Remember Spectators
    Reply With Quote #3

    This should work in other mods, but team numbers would be totally different, so you will have to adjust this.

    Add this function somewhere in code, then use IsValidClient check before GetClientTeam on 38 line
    EDIT: we dont want to do IsPlayerAlive check, so comment this out.
    PHP Code:
    public IsValidClient (client)
      
    {
        if (
    client == 0)
            return 
    false;
        
        if (!
    IsClientConnected(client))
            return 
    false;
        
        if (
    IsFakeClient(client))
            return 
    false;
        
        if (!
    IsClientInGame(client))
            return 
    false;
       
    // if (!IsPlayerAlive(client))
        //    return false;
        
    return true;

    __________________
    olj is offline
    Visual77
    Veteran Member
    Join Date: Jan 2009
    Old 08-20-2009 , 03:46   Re: [L4D] Remember Spectators *v1.1*
    Reply With Quote #4

    Thanks. But the error message is still their with the new version.
    Code:
    L 08/20/2009 - 10:21:56: SourceMod error session started
    L 08/20/2009 - 10:21:56: Info (map "l4d_vs_hospital05_rooftop") (file "errors_20090820.log")
    L 08/20/2009 - 10:21:56: [SM] Native "GetClientTeam" reported: Client 14 is not in game
    L 08/20/2009 - 10:21:56: [SM] Displaying call stack trace for plugin "l4d_spec_remember.smx":
    L 08/20/2009 - 10:21:56: [SM] [0] Line 38, /home/groups/alliedmodders/forums/files/4/4/5/7/4/47874.attach::Event_RoundEnd()
    L 08/20/2009 - 10:22:11: [SM] Native "GetClientTeam" reported: Client 14 is not in game
    L 08/20/2009 - 10:22:11: [SM] Displaying call stack trace for plugin "l4d_spec_remember.smx":
    L 08/20/2009 - 10:22:11: [SM] [0] Line 38, /home/groups/alliedmodders/forums/files/4/4/5/7/4/47874.attach::Event_RoundEnd()

    Last edited by Visual77; 08-20-2009 at 04:26.
    Visual77 is offline
    olj
    Veteran Member
    Join Date: Jun 2009
    Old 08-20-2009 , 04:30   Re: [L4D] Remember Spectators *v1.1*
    Reply With Quote #5

    There is no reason why adding valid client checking would screw this. Was there any other changes form 1.0?
    __________________
    olj is offline
    Visual77
    Veteran Member
    Join Date: Jan 2009
    Old 08-20-2009 , 04:35   Re: [L4D] Remember Spectators *v1.1*
    Reply With Quote #6

    Don't know either. The plugin works but those error messages needs to be taken care of.
    I think he only did what you said yesterday, can't see anything different from 1.0 and 1.1
    Visual77 is offline
    olj
    Veteran Member
    Join Date: Jun 2009
    Old 08-20-2009 , 04:39   Re: [L4D] Remember Spectators *v1.1*
    Reply With Quote #7

    Quote:
    Originally Posted by Visual77 View Post
    Don't know either. The plugin works but those error messages needs to be taken care of.
    I think he only did what you said yesterday, can't see anything different from 1.0 and 1.1
    So, it works but there is still erors?
    EDIT: OH, well, validation check should be put BEFORE Any other checks. Can you swap this on your self? I cant edit 1st post.
    __________________

    Last edited by olj; 08-20-2009 at 04:44.
    olj is offline
    Visual77
    Veteran Member
    Join Date: Jan 2009
    Old 08-20-2009 , 04:41   Re: [L4D] Remember Spectators *v1.1*
    Reply With Quote #8

    Yeah.
    Visual77 is offline
    Visual77
    Veteran Member
    Join Date: Jan 2009
    Old 08-20-2009 , 04:46   Re: [L4D] Remember Spectators *v1.1*
    Reply With Quote #9

    You mean at line 38?
    Visual77 is offline
    olj
    Veteran Member
    Join Date: Jun 2009
    Old 08-20-2009 , 04:54   Re: [L4D] Remember Spectators *v1.1*
    Reply With Quote #10

    Quote:
    Originally Posted by Visual77 View Post
    Yeah.
    Ofcourse.
    __________________
    olj 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 22:47.


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