bt-target icon indicating copy to clipboard operation
bt-target copied to clipboard

Added the ability to add vehicle bones

Open TheeDeer opened this issue 3 years ago • 24 comments

Good for things like opening doors, repairing engines etc, added an example use case at the bottom as well.

TheeDeer avatar Mar 11 '21 18:03 TheeDeer

When you have more than one bones added and you look from one bone to another it will close the menu and you cannot open it again until you restart the script.

Let me review once again, It is working on my server perfectly fine.

TheeDeer avatar Mar 11 '21 18:03 TheeDeer

Should be fixed, Sorry about that. I altered this script on my server to use acePermissions, and when adding it back here I forgot to undo my permissions check.

TheeDeer avatar Mar 11 '21 18:03 TheeDeer

I would remove the comment from the bottom of the client code and add it to the README as an example instead. I'll upload an example of what I meant with my other comment, it renders this pretty unusable if you want different functions for different bones.

Edit: I'm no longer able to reproduce this issue, if I find a way to reliablely reproduce I will update. Other than that LGTM

LiamDormon avatar Mar 12 '21 14:03 LiamDormon

I would remove the comment from the bottom of the client code and add it to the README as an example instead. I'll upload an example of what I meant with my other comment, it renders this pretty unusable if you want different functions for different bones.

Edit: I'm no longer able to reproduce this issue, if I find a way to reliablely reproduce I will update. Other than that LGTM

I have managed to reproduce this issue if i have more than 1 Bone inserted in the system, for example "platelight" and "boot" i had added, it was fine if i just had platelight added, however when i add boot and im Focused on the menu and move away it i need to restart the script to use the eyemenu again.

Rosw3lluk avatar Mar 12 '21 14:03 Rosw3lluk

I have managed to reproduce this issue if i have more than 1 Bone inserted in the system, for example "platelight" and "boot" i had added, it was fine if i just had platelight added, however when i add boot and im Focused on the menu and move away it i need to restart the script to use the eyemenu again.

I have doors registered to lock my vehicle and the plate / boot registered to run the plate, I had this issue previously but I'm using the changes from this fork and restarted the server and cannot replicate any more. It's rather baffling

LiamDormon avatar Mar 12 '21 14:03 LiamDormon

I was wondering if it could potentially be being caused by the loop focused on one thing, then it "Instantly closing the NUI" then instantly attempting to reopen it again, and its crashing either the JS or the nui focus due to the loop running so quick it only seems to do it when im focused never if i unfocus and then look then refocus

Rosw3lluk avatar Mar 12 '21 14:03 Rosw3lluk

I was wondering if it could potentially be being caused by the loop focused on one thing, then it "Instantly closing the NUI" then instantly attempting to reopen it again, and its crashing either the JS or the nui focus due to the loop running so quick it only seems to do it when im focused never if i unfocus and then look then refocus

https://streamable.com/ii9kp6 Yeah I'm struggling to recreate this again, I had this problem yesterday.

LiamDormon avatar Mar 12 '21 14:03 LiamDormon

I was wondering if it could potentially be being caused by the loop focused on one thing, then it "Instantly closing the NUI" then instantly attempting to reopen it again, and its crashing either the JS or the nui focus due to the loop running so quick it only seems to do it when im focused never if i unfocus and then look then refocus

https://streamable.com/ii9kp6 Yeah I'm struggling to recreate this again, I had this problem yesterday.

https://streamable.com/n6p0g0

Just taken this now as we have been commenting

Rosw3lluk avatar Mar 12 '21 14:03 Rosw3lluk

https://streamable.com/n6p0g0

Just taken this now as we have been commenting

Possibly because OP added different jobs to each option? I've removed that on mine. @TheeDeer might be worth considering removing that from the PR

LiamDormon avatar Mar 12 '21 15:03 LiamDormon

To be honest i have different jobs on all my options, as its easier than redrawing the polys each time, i have them on zones, peds, models etc.. it literally is just this part that messes up sometimes,

Rosw3lluk avatar Mar 12 '21 15:03 Rosw3lluk

Suprisingly just removing the following 2 lines from the last update

targetActive = false
SendNUIMessage({response = "closeTarget"})

Has completely resolved my issue of it crashing, including keeping the job stuff in there 😕

Rosw3lluk avatar Mar 12 '21 15:03 Rosw3lluk

Let me know if any more issues arise, sorry the fork I have for my server is heavily altered compared to the main branch.

TheeDeer avatar Mar 12 '21 16:03 TheeDeer

ditto

PhilsBadMan avatar Mar 14 '21 01:03 PhilsBadMan

ditto

Same issue here.

NikolaiFN avatar Mar 14 '21 04:03 NikolaiFN

This issue does seem to be present still, however i have found that if i pull my weapon out and put it back away it seems to allow the eyemenu to work again.

Rosw3lluk avatar Mar 15 '21 07:03 Rosw3lluk

Okay to fix this i removed the if success then return end

at the top of the action function, and it seems to stop causing the EyeMenu to stop responding and always seems to work for me now,

Rosw3lluk avatar Mar 16 '21 20:03 Rosw3lluk

Okay to fix this i removed the if success then return end

at the top of the action function, and it seems to stop causing the EyeMenu to stop responding and always seems to work for me now,

Only issue im having now is removing that sometimes the eyemenu now gets stuck open randomly when you open it. Until you hover over a target and click into it and then leave the target.

NikolaiFN avatar Mar 17 '21 20:03 NikolaiFN

@Mojito-Fivem Done

TheeDeer avatar Mar 18 '21 19:03 TheeDeer

Hey Mate! @TheeDeer

I tried the code more than once and event directly copied the code from your repository but I always have the same issue. When I target ex. the engine and after I look somewhere else on the vehicle, I still have the engine option. I can't have the doors options after looking at the engine and not stopping to look at the vehicle..

ArcadiusMachine avatar Apr 23 '21 15:04 ArcadiusMachine

Take a look at my commit here, I've added

targetActive = false
SendNUIMessage({response = "closeTarget"})

to the function and seems to fix the issue.

LiamDormon avatar Apr 23 '21 17:04 LiamDormon

Just tried it @Mojito-Fivem but it doesn't work...

ArcadiusMachine avatar Apr 23 '21 17:04 ArcadiusMachine

Just tried it @Mojito-Fivem but it doesn't work...

¯\_(ツ)_/¯ Works for me

LiamDormon avatar Apr 23 '21 17:04 LiamDormon

@Mojito-Fivem Possible to message via Discord? MrZax2000#0001

ArcadiusMachine avatar Apr 23 '21 19:04 ArcadiusMachine

@Mojito-Fivem Possible to message via Discord? MrZax2000#0001

No.

LiamDormon avatar Apr 23 '21 20:04 LiamDormon