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

OnPlayerRunCmd button spectate magic (TF2)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 12-03-2013 , 12:43   OnPlayerRunCmd button spectate magic (TF2)
Reply With Quote #1

What I'd like to do is disable automatic respawns and after the (or depending on the game mode a) time penalty allow people to manually respawn by pressing fire.
The issue with this is that the button does not seem to be recognized. It works during the killcam moment, but as soon as the camera switches back and forces me to look at the control point (it is an arena map), the game likes to pretend that I am not clicking the left mouse button.

I have tried to set "mp_forcecamera" to 0 and also manually set the entity's movetype to "FLY" but none of this worked.

As always I am more than grateful for any ideas.
House
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.
Dr. Greg House is offline
NIGathan
Senior Member
Join Date: Aug 2011
Location: /dev/null
Old 12-03-2013 , 19:36   Re: OnPlayerRunCmd button spectate magic (TF2)
Reply With Quote #2

I noticed that the IN_ATTACK button didn't work in that case as well a little while ago. I ended up settling for IN_RELOAD. But I do suppose you could check who the client is spectating and wait for it to change to a new client or observer point. Here's the offset for that:
PHP Code:
iMode GetEntProp(clientProp_Send"m_iObserverMode");
iTarget GetEntPropEnt(clientProp_Send"m_hObserverTarget"); 
NIGathan is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 12-04-2013 , 02:28   Re: OnPlayerRunCmd button spectate magic (TF2)
Reply With Quote #3

I ended up trying to hook one of these and see when which one fires instead of polling the prop:

Code:
            "StartObserverMode"
            {
                "windows"    "434"
                "linux"        "369"
            }
            "StopObserverMode"
            {
                "windows"    "434"
                "linux"        "370"
            }
            "SetObserverMode"
            {
                "windows"    "434"
                "linux"        "372"
            }
            "GetObserverMode"
            {
                "windows"    "434"
                "linux"        "373"
            }
            "SetObserverTarget"
            {
                "windows"    "434"
                "linux"        "374"
            }
            "GetObserverTarget"
            {
                "windows"    "434"
                "linux"        "376"
            }
            "FindNextObserverTarget"
            {
                "windows"    "434"
                "linux"        "377"
            }
            "IsValidObserverTarget"
            {
                "windows"    "434"
                "linux"        "379"
            }
Turns out you need to set the cvar mentioned earlier to 0 for that to work.
I have settled for the reload-button as well.

Many thanks!
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.
Dr. Greg House 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 20:19.


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