PDA

View Full Version : Any Way to Check if Client is in Thirdperson View?


Spirrwell
02-23-2016, 23:33
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.

nosoop
02-24-2016, 02:18
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 (https://github.com/bcserv/smlib/blob/master/scripting/include/smlib/clients.inc#L234).

If all else fails, you can grab tEntDev (https://forums.alliedmods.net/showthread.php?t=143081) and watch the netprop changes. Not sure if there's anything similar for datamaps.

Spirrwell
02-24-2016, 07:23
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.