npwd icon indicating copy to clipboard operation
npwd copied to clipboard

Update vehicle anims for motorcycle

Open Deniel00 opened this issue 3 years ago • 6 comments

Pull Request Description

Updated in vehicle anims for working motorcycles. kép old anim kép

Pull Request Checklist:

  • [x] Have you followed the guidelines in our Contributing document and Code of Conduct?
  • [x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • [x] Have you built and tested NPWD in-game after the relevant change?

Deniel00 avatar May 16 '22 10:05 Deniel00

image With your changes the ped now sits forward in the car and they have to leave the car, pull the phone out and put it away again to return to the normal driving animation. The same issue occurs on motorcycles where the pen is stuck with their hand in the air.

LiamDormon avatar May 16 '22 18:05 LiamDormon

You'd need to change the dict/anim based off the class the player is in.

https://github.com/project-error/npwd/blob/8bec2f254dc57f18f9964df60538df0db2446124/resources/client/animations/animation.service.ts#L50

private handleCallAnimation(playerPed: number) {
    if (IsPedInAnyVehicle(playerPed, true)) {
      this.handleOnCallInVehicle(playerPed);
    } else {
      this.handleOnCallNormal(playerPed);
    }
  }

  private handleOpenAnimation(playerPed: number) {
    if (IsPedInAnyVehicle(playerPed, true)) {
      this.handleOpenVehicleAnim(playerPed);
    } else {
      this.handleOpenNormalAnim(playerPed);
    }
  }

  private handleCallEndAnimation(playerPed: number) {
    if (IsPedInAnyVehicle(playerPed, true)) {
      this.handleCallEndVehicleAnim(playerPed);
    } else {
      this.handleCallEndNormalAnim(playerPed);
    }
  }

  private handleCloseAnimation(playerPed: number) {
    if (IsPedInAnyVehicle(playerPed, true)) {
      this.handleCloseVehicleAnim(playerPed);
    } else {
      this.handleCloseNormalAnim(playerPed);
    }
  }

You'd need to pass the class to the anim functions and then adjust the dics based off the class, can refer to the docs https://docs.fivem.net/natives/?_0x29439776AAA00A62. Your approach wouldn't work without rewriting your current pr entirely as you assume player vehicle = motorcycle where current method is just a blanket solution for most vehicle classes with the obvious exception of bikes. You'd just compare current class to see if its 8 and adjust the dics/anim locals accordingly.

RockySouthpaw avatar May 17 '22 02:05 RockySouthpaw

As soon as possible I'm check this and editing.

Deniel00 avatar May 17 '22 16:05 Deniel00

I'm updated file for check player is in vehicle or motorcycles, but if in vehicles always restart opening animation and didn't find why made this.

Deniel00 avatar May 20 '22 18:05 Deniel00

Fixed formating and using let/const

Deniel00 avatar May 20 '22 18:05 Deniel00

I'll test it this week.

itschip avatar Jun 02 '22 08:06 itschip

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 02 '22 17:10 stale[bot]

After lots of anim version checking and open/close test, there is too much problem.

  • lots of anim stuck
  • prop missing

Deniel00 avatar Oct 07 '22 10:10 Deniel00