Raised This Month: $51 Target: $400
 12% 

Any Way to Check if Client is in Thirdperson View?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Spirrwell
Member
Join Date: Jul 2013
Old 02-23-2016 , 23:33   Any Way to Check if Client is in Thirdperson View?
Reply With Quote #1

Hi there, I've been working on a hats plugin for this mod I play, and the only brick wall I've seem to hit so far is the fact that there seems to be no way for me to check if the player is in thirdperson or firstperson and hide the hat accordingly.

Is there some direct data or send prop that will allow me to check for that? If not, is there any sort of hack I can do like checking if the viewmodel is in view through a transmit state or something?

Oh and the mod is Pirates, Vikings, and Knights II just in case that's relevant.
Spirrwell is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 02-24-2016 , 02:18   Re: Any Way to Check if Client is in Thirdperson View?
Reply With Quote #2

I'm not familiar with PVK2 so take this with a grain of salt, but looking at a datamap dump from 2010 tells me that it probably does have the m_iObserverMode property, which may be usable depending on how your particular game handles third-person mode. It seems common enough that SMLIB has a function stock for it.

If all else fails, you can grab tEntDev and watch the netprop changes. Not sure if there's anything similar for datamaps.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
Spirrwell
Member
Join Date: Jul 2013
Old 02-24-2016 , 07:23   Re: Any Way to Check if Client is in Thirdperson View?
Reply With Quote #3

I checked the m_iObserverMode thing, and it seems that it's always 0 regardless of whether you're in thirdperson or firstperson. It only changes if you're in spectator or something.

I tried the tEntDev, and it failed to even load so I'm going to continue looking into that. However, I did notice that with cl_pdump on and changing between thirdperson and firstperson, there was something called m_iEFlags that was changing by 32. Which in looking in code seems to be this:

EFL_DIRTY_SHADOWUPDATE = (1<<5), // Client only- need shadow manager to update the shadow...

I could get the Prop_Data m_iEFlags and check against that flag, but checking client indexes seems to return a different m_iEFlags than what I see on cl_pdump.

Last edited by Spirrwell; 02-24-2016 at 08:38.
Spirrwell 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 05:46.


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