Raised This Month: $ Target: $400
 0% 

Simple Spectate


Post New Thread Reply   
 
Thread Tools Display Modes
Antithasys
Moderator
Join Date: Apr 2008
Old 09-07-2009 , 20:49   Re: Simple Spectate
Reply With Quote #21

Quote:
Originally Posted by DontWannaName View Post
It was last updated in July though. What I meant was I was specing people while playing so when I was dead it would send me to them. When the round ended I got switched out of my team to spectate instead of to the other team.
Yes, that happened because I didn't cleanup the variables when you left spectator. I am working on a fix now.

You would switch teams, and never do a !stopspec or toggle !spec. So when your spectator target died, and spawned, you would once again be moved to spectator and spectating them. The only way to stop it was to do !stopspec. Like I said, I will do an automatic stop if you leave the spectator team.
__________________
[my plugins]

When you think about asking a question... consider what have you tried?
Antithasys is offline
retsam
Veteran Member
Join Date: Aug 2008
Location: so-cal
Old 09-10-2009 , 16:16   Re: Simple Spectate
Reply With Quote #22

Couple things.

1) I guess the CreateHudSynchronizer stuff doesnt work in DODS?

Anyways, in my plugin for DODS, I have added Printtochat messages that happen every 15 seconds to display the name and steamids as I kinda need that. Is there any better way to do that in dods?

2) You might consider editing your "Spectating" section in the translation file to inform them of pressing !spec again to stop it as well.

"Now spectating {1}. Type !spec, !stopspec or /stopspec to stop spectating this player"

3) Im not sure why it isnt, but can you block the chat triggers for this? ALSO, It would be awesome if you blocked the joining spectator message for people who joined spectate with the trigger. It kinda gives you away if they see you typing a chat trigger then joining spectate...

4) You also have a bug that if you are specing someone with timer going, and then join a team without ending the spec, it doesnt do the cleanup. I fixed it by hooking team change and doing cleanup if their team is > 1.

Code:
HookEvent("player_team", HookChangePlayerTeam, EventHookMode_Pre);

public Action:HookChangePlayerTeam(Handle:event, const String:name[], bool:dontBroadcast)
{
        if(GetEventInt(event,"team") == 1){
            new client = GetClientOfUserId(GetEventInt(event,"userid"));
            if(g_IsSpecingPlayer[client] != 0)
                return Plugin_Handled;
        
    return Plugin_Continue;  
        }
        else if(GetEventInt(event,"team") > 1){
      new client = GetClientOfUserId(GetEventInt(event,"userid"));
      if(g_aPlayers[client][iSpectatorTarget] != 0){
        CleanUp(client);
        return Plugin_Continue;
      }   
        }
        return Plugin_Continue;
}
(the first part of that hook blocks the join spectate msg if they have a variable set on them. I had to add a new variable for the check, as it didnt get the target info until after it switched them )


Last edited by retsam; 09-10-2009 at 18:36.
retsam is offline
Antithasys
Moderator
Join Date: Apr 2008
Old 09-15-2009 , 19:36   Re: Simple Spectate
Reply With Quote #23

Quote:
Originally Posted by retsam View Post
Couple things.

1) I guess the CreateHudSynchronizer stuff doesnt work in DODS?

Anyways, in my plugin for DODS, I have added Printtochat messages that happen every 15 seconds to display the name and steamids as I kinda need that. Is there any better way to do that in dods?
I have some ideas... I will include this in the next update.

Quote:
Originally Posted by retsam View Post
2) You might consider editing your "Spectating" section in the translation file to inform them of pressing !spec again to stop it as well.

"Now spectating {1}. Type !spec, !stopspec or /stopspec to stop spectating this player"
I guess.

Quote:
Originally Posted by retsam View Post
3) Im not sure why it isnt, but can you block the chat triggers for this? ALSO, It would be awesome if you blocked the joining spectator message for people who joined spectate with the trigger. It kinda gives you away if they see you typing a chat trigger then joining spectate...
If you use ! it will not block it. If you use / it will block it. They are public/silent triggers built into sourcemod when a command is made with a sm_ prefix.

Quote:
Originally Posted by retsam View Post
4) You also have a bug that if you are specing someone with timer going, and then join a team without ending the spec, it doesnt do the cleanup. I fixed it by hooking team change and doing cleanup if their team is > 1.
Yes, as I have said a fix will be in next update.

Quote:
Originally Posted by retsam View Post
Code:
HookEvent("player_team", HookChangePlayerTeam, EventHookMode_Pre);

public Action:HookChangePlayerTeam(Handle:event, const String:name[], bool:dontBroadcast)
{
        if(GetEventInt(event,"team") == 1){
            new client = GetClientOfUserId(GetEventInt(event,"userid"));
            if(g_IsSpecingPlayer[client] != 0)
                return Plugin_Handled;
        
    return Plugin_Continue;  
        }
        else if(GetEventInt(event,"team") > 1){
      new client = GetClientOfUserId(GetEventInt(event,"userid"));
      if(g_aPlayers[client][iSpectatorTarget] != 0){
        CleanUp(client);
        return Plugin_Continue;
      }   
        }
        return Plugin_Continue;
}
(the first part of that hook blocks the join spectate msg if they have a variable set on them. I had to add a new variable for the check, as it didnt get the target info until after it switched them )
__________________
[my plugins]

When you think about asking a question... consider what have you tried?
Antithasys is offline
Antithasys
Moderator
Join Date: Apr 2008
Old 09-16-2009 , 18:04   Re: Simple Spectate
Reply With Quote #24

Quote:
1.0.98
Rewrote much of the base code
Added menu hud type
Added panel hud type
Made hud always display when in spectator
Added toggle for hud information sm_specinfo
Added ability to spec current target via menu hud
Added alias sm_observe
Added alias sm_endobserve
Added check and disabled ability to observe plugin
Added Steam Bans support with sb_status
Added cvar sm_spectate_hudmode
Added cvar sm_spectate_menutype
__________________
[my plugins]

When you think about asking a question... consider what have you tried?
Antithasys is offline
Jamster
Veteran Member
Join Date: Jun 2008
Old 09-16-2009 , 20:03   Re: Simple Spectate
Reply With Quote #25

Nice update, though when you respawn you get an annoying message about you stopped spectating someone but it's the server name instead of a player, is it possible to suppress this?

Here's a screenie:
http://i30.tinypic.com/2mhwq2r.jpg
Jamster is offline
Antithasys
Moderator
Join Date: Apr 2008
Old 09-16-2009 , 21:24   Re: Simple Spectate
Reply With Quote #26

Ya, found that myself. I will do a quick update... again...
__________________
[my plugins]

When you think about asking a question... consider what have you tried?
Antithasys is offline
Antithasys
Moderator
Join Date: Apr 2008
Old 09-16-2009 , 23:21   Re: Simple Spectate
Reply With Quote #27

Quote:
1.0.99
Removed hud when in freelook mode
Fixed bug where message would display on team change/spawn
Fixed bug in Disconnect_Post in target name
Fixed bug in !spec command not displaying menu
Added plugin tag to invalid target message
__________________
[my plugins]

When you think about asking a question... consider what have you tried?

Last edited by Antithasys; 09-16-2009 at 23:28.
Antithasys is offline
tcviper
Veteran Member
Join Date: Oct 2005
Location: Netherlands
Old 09-17-2009 , 04:54   Re: Simple Spectate
Reply With Quote #28

Request Antithasys can you add a cvar to enable auto sb_status call when speccing a player or an option in the menu to call it?

For Steambans.com enabled servers people need to do sb_status in console once to grab a special code that proves its the right player your looking at and this needs to be called once in console WHILE recording / speccing.
__________________
tcviper is offline
Send a message via MSN to tcviper
Antithasys
Moderator
Join Date: Apr 2008
Old 09-17-2009 , 19:10   Re: Simple Spectate
Reply With Quote #29

Quote:
Originally Posted by tcviper View Post
Request Antithasys can you add a cvar to enable auto sb_status call when speccing a player or an option in the menu to call it?

For Steambans.com enabled servers people need to do sb_status in console once to grab a special code that proves its the right player your looking at and this needs to be called once in console WHILE recording / speccing.
Told you in chat, but figured I would post here. That was already implemented in 1.0.98. If you start to follow a player and have SteamBans installed, it will run sb_status for you.
__________________
[my plugins]

When you think about asking a question... consider what have you tried?
Antithasys is offline
tcviper
Veteran Member
Join Date: Oct 2005
Location: Netherlands
Old 09-18-2009 , 03:52   Re: Simple Spectate
Reply With Quote #30

Can this be set to be shown and activated by admins (flag) only?
I dont want all players to be able to use/see this.
__________________
tcviper is offline
Send a message via MSN to tcviper
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:10.


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