Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setPedAimTarget doesn't work on players #380

Open
ArranTuna opened this issue Sep 3, 2018 · 5 comments
Open

setPedAimTarget doesn't work on players #380

ArranTuna opened this issue Sep 3, 2018 · 5 comments
Labels
enhancement New feature or request
Milestone

Comments

@ArranTuna
Copy link
Collaborator

ArranTuna commented Sep 3, 2018

Describe the bug
setPedAimTarget has no effect on players.

Expected behavior
setPedAimTarget should work, at least when the camera isn't focused on the local player. That would give scripters more control over shooting, especially when they want to script the camera themselves (such as FPS).

Additional context

@Kenix157 said:

Without this thing, you can't do your own custom hud with aim target.

From https://bugs.mtasa.com/view.php?id=5665

@ArranTuna ArranTuna added the enhancement New feature or request label Sep 3, 2018
@PlatinMTA
Copy link
Contributor

PlatinMTA commented Sep 4, 2018

When making an FPS type camera I encounter the same issue. I think that maybe it isn't posible to do that because sync or maybe because it could be exploited from a client to make a sort of autoaim, thing that i doubt.

@Einheit-101
Copy link

Einheit-101 commented Sep 4, 2018

Indeed useful for recoil, auto-aim, sniper-scope sway and maybe even more stuff.

What happens if you comment this out:
void CClientPed::SetTargetTarget ( unsigned long ulDelay, const CVector& vecSource, const CVector& vecTarget )
{
if ( !m_bIsLocalPlayer ) <---------------

@patrikjuvonen patrikjuvonen added this to the Backlog milestone Sep 5, 2018
@qaisjp
Copy link
Contributor

qaisjp commented Sep 6, 2018

@Jusonex said:

As a temp fix, you can set the camera target using setCameraTarget (a new "overloading" has been added in r5212).

The aiming offsets which you'll need for the calculation are on my wiki page.

@Einheit-101
Copy link

Einheit-101 commented Jan 26, 2019

I would really like to see this fixed because i am working on a script that requires the local player to aim at a certain point while the camera is set by setCameraMatrix(). However, has still no one tried commenting out "if ( !m_bIsLocalPlayer )" ? I would try it myself but i have no clue where to find that code snippet and how to compile it after changing it.

@Dezash
Copy link
Contributor

Dezash commented Apr 29, 2020

I tried removing all local player checks and it still didn't change the aiming direction of the local player.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants