AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Remember Spectators v1.2.5 (https://forums.alliedmods.net/showthread.php?t=100978)

bman87 08-19-2009 17:41

Remember Spectators v1.2.5
 
10 Attachment(s)
*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... :shock:
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.

Visual77 08-19-2009 19:16

Re: [L4D] Remember Spectators
 
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.


olj 08-19-2009 19:30

Re: [L4D] Remember Spectators
 
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;



Visual77 08-20-2009 03:46

Re: [L4D] Remember Spectators *v1.1*
 
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()


olj 08-20-2009 04:30

Re: [L4D] Remember Spectators *v1.1*
 
There is no reason why adding valid client checking would screw this. Was there any other changes form 1.0?

Visual77 08-20-2009 04:35

Re: [L4D] Remember Spectators *v1.1*
 
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

olj 08-20-2009 04:39

Re: [L4D] Remember Spectators *v1.1*
 
Quote:

Originally Posted by Visual77 (Post 906432)
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.

Visual77 08-20-2009 04:41

Re: [L4D] Remember Spectators *v1.1*
 
Yeah.

Visual77 08-20-2009 04:46

Re: [L4D] Remember Spectators *v1.1*
 
You mean at line 38?

olj 08-20-2009 04:54

Re: [L4D] Remember Spectators *v1.1*
 
Quote:

Originally Posted by Visual77 (Post 906439)
Yeah.

Ofcourse.

bman87 08-20-2009 08:21

Re: [L4D] Remember Spectators v1.1.1
 
Hopefully this is fixed now.. I just moved the team checking method into the IsValidClient() method.

Visual77 08-21-2009 09:59

Re: [L4D] Remember Spectators v1.1.1
 
Yeah, error seems to be fixed.

There seems to be a new problem though. A friend of mine told me that if you've been on spectate mode a bit longer (lets say for 3 mapchanges) and then goes back to the game, you will get switched to spectate automaticly on next mapchange. You'll basicly be forced to spectate on every map change, even though you have joined the survivor/infected again.

This problem is hard to describe, I think I've seen it when I joined the game as spectator twice. The problem seems to be very rare though.
Dosen't happen if you go spectate for one map change.

bman87 08-21-2009 10:14

Re: [L4D] Remember Spectators v1.1.1
 
Just added a check to see if the client was in the spectators array when they change teams, if they are it will remove them from the array. Hopefully preventing your issue

Visual77 08-21-2009 10:19

Re: [L4D] Remember Spectators v1.2
 
Thanks. I'll report back if I see any trouble.

bman87 08-21-2009 10:33

Re: [L4D] Remember Spectators v1.2.1
 
Whoops, download the plugin again... I forgot to add IsValidClient() to the team change method.... :down:

Visual77 08-21-2009 10:44

Re: [L4D] Remember Spectators v1.2.1
 
Done.

Visual77 08-21-2009 11:49

Re: [L4D] Remember Spectators v1.2.1
 
It just happend again. Was spectating on the first 2 maps, joined the infected team at the 3rd. On the 4th, just after the loading screen I was put back on spectate mode again. Was tested with 1.2.1

bman87 08-21-2009 12:08

Re: [L4D] Remember Spectators v1.2.1
 
Can you test this version and let me know if its still broken?

olj 08-21-2009 12:26

Re: [L4D] Remember Spectators v1.2.1
 
Quote:

Originally Posted by bman87 (Post 908018)
Can you test this version and let me know if its still broken?

Nice decision :). Clearing array before round end and then writing spectator's steam id's should fix this.

bman87 08-21-2009 12:31

Re: [L4D] Remember Spectators v1.2.1
 
Quote:

Originally Posted by olj (Post 908040)
Nice decision :). Clearing array before round end and then writing spectator's steam id's should fix this.

I hope so! I disabled the team change check in my post above, not sure why that didn't work. But it will be re-enabled once I get confirmation the bug is gone. I think the team change check is needed if someone is spectator, joins a team, then reconnected before a round_end is triggered.

Zverina 08-21-2009 12:35

Re: [L4D] Remember Spectators v1.2.1
 
yes thank god someone made this plugin xD my friend seems to go afk almost all the time during a game and it seems to get annoying havin to switch him back to spec every time xD

Visual77 08-21-2009 13:32

Re: [L4D] Remember Spectators v1.2.3
 
Test version worked perfect.
I assume you added back that check in 1.2.3 so I'm taking that one.

Visual77 08-22-2009 04:05

Re: [L4D] Remember Spectators v1.2.3
 
Had another error this morning, it's been on almost every map.
Fix this and release a new update.

Code:

L 08/22/2009 - 07:44:28: SourceMod error session started
L 08/22/2009 - 07:44:28: Info (map "l4d_vs_hospital01_apartment") (file "errors_20090822.log")
L 08/22/2009 - 07:44:28: [SM] Native "RemoveFromArray" reported: Invalid index 0 (count: 0)
L 08/22/2009 - 07:44:28: [SM] Displaying call stack trace for plugin "l4d_spec_remember.smx":
L 08/22/2009 - 07:44:28: [SM]  [0]  Line 61, /home/groups/alliedmodders/forums/files/4/4/5/7/4/47874.attach::OnClientPostAdminCheck()
L 08/22/2009 - 07:54:51: Error log file session closed.
L 08/22/2009 - 09:47:39: SourceMod error session started
L 08/22/2009 - 09:47:39: Info (map "l4d_vs_smalltown03_ranchhouse") (file "errors_20090822.log")
L 08/22/2009 - 09:47:39: [SM] Native "RemoveFromArray" reported: Invalid index 0 (count: 0)
L 08/22/2009 - 09:47:39: [SM] Displaying call stack trace for plugin "l4d_spec_remember.smx":
L 08/22/2009 - 09:47:39: [SM]  [0]  Line 61, /home/groups/alliedmodders/forums/files/4/4/5/7/4/47874.attach::OnClientPostAdminCheck()


bman87 08-22-2009 11:50

Re: [L4D] Remember Spectators v1.2.4
 
I added an additional check. v1.2.4

Visual77 08-22-2009 13:17

Re: [L4D] Remember Spectators v1.2.4
 
Thanks.

Visual77 08-22-2009 15:06

Re: [L4D] Remember Spectators v1.2.4
 
Code:

L 08/22/2009 - 20:32:24: Info (map "l4d_vs_hospital01_apartment") (file "errors_20090822.log")
L 08/22/2009 - 20:32:24: [SM] Native "RemoveFromArray" reported: Invalid index 1 (count: 1)
L 08/22/2009 - 20:32:24: [SM] Displaying call stack trace for plugin "l4d_spec_remember.smx":
L 08/22/2009 - 20:32:24: [SM]  [0]  Line 63, /home/groups/alliedmodders/forums/files/4/4/5/7/4/47874.attach::OnClientPostAdminCheck()
L 08/22/2009 - 20:44:14: Error log file session closed.

Before the update I had Invalid index 0 errors.

olj 08-22-2009 15:08

Re: [L4D] Remember Spectators v1.2.4
 
Something with arrays indexes. Maybe its trying to remove target from array index, which is already empty??

Visual77 08-22-2009 15:51

Re: [L4D] Remember Spectators v1.2.4
 
No idea but I only got the error once.
I don't know why it gave me the error now when I've been using it without errors for 2-3 hours.

bman87 08-22-2009 15:55

Re: [L4D] Remember Spectators v1.2.4
 
Try this one. Maybe clients are getting removed when they are team changed by the server when the round is over. Try the new version, I disabled the team_change hook.

Visual77 08-22-2009 17:39

Re: [L4D] Remember Spectators v1.2.5
 
I will let it run a couple of hours. I'll report back if I get any more erros.

Bootcore 09-06-2009 01:05

Re: [L4D] Remember Spectators v1.2.5
 
The plugin looks the steam id, how can i change to look the nick of the player and no steam id ?

danmala 09-07-2009 12:37

Re: [L4D] Remember Spectators v1.2.5
 
Quote:

Originally Posted by Bootcore (Post 924556)
The plugin looks the steam id, how can i change to look the nick of the player and no steam id ?

i want that too :wink:

n0limit 09-07-2009 13:50

Re: [L4D] Remember Spectators v1.2.5
 
Cool plugin man, makes respecing constantly for scrim matches a thing of the past! Thanks

Visual77 09-07-2009 15:14

Re: [L4D] Remember Spectators v1.2.5
 
Yeah, this plugin should have been approved by now :wink:

berni 09-12-2009 15:35

Re: [L4D] Remember Spectators v1.2.5
 
round_end is a generic round event, therefore this plugin can be used in other games too.

approved, greetings ~Berni

GAVVVR 08-22-2010 16:45

Re: [L4D] Remember Spectators v1.2.5
 
Quote:

Originally Posted by berni (Post 930872)
round_end is a generic round event, therefore this plugin can be used in other games too.

I don't understand why, but this plugin doesn't work in hl2dm. spectator's team is 1, but plugin doesn't work on mapend.

sapphire989 10-22-2010 02:19

Re: Remember Spectators v1.2.5
 
not work on L4D2 , Next Round Equally wrong team

Visual77 10-22-2010 11:11

Re: Remember Spectators v1.2.5
 
It does work. Please, don't post if you don't know what you're talking about.

rautamiekka 10-24-2010 16:39

Re: Remember Spectators v1.2.5
 
So far works on CS Source Orange.

utaker 05-20-2014 06:37

Re: Remember Spectators v1.2.5
 
anyone tested this on CSGO?


All times are GMT -4. The time now is 08:01.

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