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

Player View Angles


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 11-12-2015 , 16:55   Player View Angles
Reply With Quote #1

Can they be changed easily?

I found a function within CBasePlayer that I think can do it (SnapEyeAngles) but the project I'm working in has a problem trying to include the files that contain CBasePlayer, throwing a slew of errors like m_hOwnerEntity is undefined, m_hMoveParent undefined, m_hUseEntity, n_hVehicle, m_hObserverTarget, m_hZoomerOwner, m_hOwner, m_hLightingOrigin/Relative, m_hCtrl, m_hActiveWeapon, all undefined for some reason

I have all the environment variables set up correctly, and I included several required files, but including cbase.h throws many errors, and including just player.h does too

So my main question is 2 fold: Is there a way to change player view angles without including this, or is there a way to fix these problems and just use the premade stuff
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it
xXDeathreusXx is offline
donrevan
AlliedModders Donor
Join Date: Jul 2010
Old 11-12-2015 , 17:41   Re: Player View Angles
Reply With Quote #2

Well, tampering with the players usercmds is probably the best solution.
https://forums.alliedmods.net/showthread.php?t=255101
donrevan is offline
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 11-12-2015 , 19:30   Re: Player View Angles
Reply With Quote #3

Quote:
Originally Posted by donrevan View Post
Well, tampering with the players usercmds is probably the best solution.
https://forums.alliedmods.net/showthread.php?t=255101
I have a usercmd hook, setting cmd->viewangle does nothing, just like in a SourceMod plugin, if you do ang=ang and return Plugin_Changed it doesn't actually change the players view

Edit: And actually, in the hl2sdk in usercmd.h, it has a code block that turns some parts of the hook into local only, viewangle is one, at least that's what I'm led to believe
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it

Last edited by xXDeathreusXx; 11-12-2015 at 20:37.
xXDeathreusXx is offline
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 11-12-2015 , 21:56   Re: Player View Angles
Reply With Quote #4

WELP, everything in this has become irrelevant

It's sending the angles serverside, but not clientside, I'm shooting people behind me, the equivelant of a silent aim aimbot

It's good enough for me, but meh
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it
xXDeathreusXx is offline
donrevan
AlliedModders Donor
Join Date: Jul 2010
Old 11-13-2015 , 04:32   Re: Player View Angles
Reply With Quote #5

If you want visible view angle changes you can call CBaseAnimating?::Teleport(virtual function, no signature required).

Teleport(Vector const *newPos, QAngle const *newAngles, Vector const *newVelocity)
just pass NULL to newPos and newVelocity
donrevan is offline
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 11-13-2015 , 13:26   Re: Player View Angles
Reply With Quote #6

Quote:
Originally Posted by donrevan View Post
If you want visible view angle changes you can call CBaseAnimating?::Teleport(virtual function, no signature required).

Teleport(Vector const *newPos, QAngle const *newAngles, Vector const *newVelocity)
just pass NULL to newPos and newVelocity
I see

This is where the original problem comes in, baseentity.h has errors

Edit: Looking at the teleport code, I see it also just uses SnapEyeAnles

Edit 2: I looked at SnapEyeAngles, and it uses CPlayerState, which IServerGameClients can retrieve and use, so I used the method SnapEyeAngles uses and it works!

Spoiler
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it

Last edited by xXDeathreusXx; 11-13-2015 at 14:32.
xXDeathreusXx is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 11-13-2015 , 14:15   Re: Player View Angles
Reply With Quote #7

Congratulations, you've learnt why SM's gamedata files exist.
__________________
asherkin is offline
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 11-17-2015 , 19:39   Re: Player View Angles
Reply With Quote #8

A new problem emerged that the eye angles never leave 0.0 in pitch
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it
xXDeathreusXx is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 11-18-2015 , 02:58   Re: Player View Angles
Reply With Quote #9

I think you're probably looking at roll instead of pitch.
__________________
asherkin is offline
xXDeathreusXx
Veteran Member
Join Date: Mar 2013
Location: pPlayer->GetOrigin();
Old 11-18-2015 , 22:34   Re: Player View Angles
Reply With Quote #10

Quote:
Originally Posted by asherkin View Post
I think you're probably looking at roll instead of pitch.
No, it's pitch, I can't get it to leave 0.0 when it finds a target, it snaps almost like it get's locked

The piece of code I have was being used on bots
__________________
Plugins|Profile
Requests closed

I'm a smartass by nature, get used to it
xXDeathreusXx is offline
Reply


Thread Tools
Display Modes

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 19:34.


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