Raised This Month: $ Target: $400
 0% 

[TF2] Thirdperson that works after death


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Darkimmortal
Senior Member
Join Date: Aug 2008
Old 03-14-2009 , 23:56   [TF2] Thirdperson that works after death
Reply With Quote #1

First, you need to implement the following function passing 0 to viewstate when a player dies and 1 when they spawn:

PHP Code:
stock SwitchView(targetviewstate){
    if (
viewstate >= 1){
        
SetEntPropEnt(targetProp_Send"m_hObserverTarget"target);
        
SetEntProp(targetProp_Send"m_iObserverMode"1);
        
SetEntProp(targetProp_Send"m_bDrawViewmodel"0);
    } else {
        
SetEntPropEnt(targetProp_Send"m_hObserverTarget", -1);
        
SetEntProp(targetProp_Send"m_iObserverMode"0);
        
SetEntProp(targetProp_Send"m_bDrawViewmodel"1);
    }

Next, in the death event AFTER the call to SwitchView, add this:

PHP Code:
CreateTimer(0.1Timer_Ragdollclient); 
And then add this timer to your code:

PHP Code:
public Action:Timer_Ragdoll(Handle:timerany:client){
    if(
IsClientInGame(client)){
        
RemoveEdict(GetEntPropEnt(clientProp_Send"m_hRagdoll"));
    }

It took me three days to find out how to avoid this annoying bug (when you die, the camera is permanently locked on to your dead body until you leave the server).

This (removing the ragdoll instantly) is one of two workarounds; the other screws up the camera and isn't worth having.
__________________

Last edited by Darkimmortal; 03-15-2009 at 00:13.
Darkimmortal is offline
bobbobagan
SourceMod Donor
Join Date: May 2007
Location: New Zealand
Old 03-15-2009 , 07:15   Re: [TF2] Thirdperson that works after death
Reply With Quote #2

Hey DI,

I know you from W-BB More on topic, thanks for pointing this out.
__________________
bobbobagan is offline
Send a message via Skype™ to bobbobagan
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 08:10.


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