brentN5 / bt-target

GNU General Public License v3.0
36 stars 52 forks source link

Added the ability to add vehicle bones #8

Open TheeDeer opened 3 years ago

TheeDeer commented 3 years ago

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

TheeDeer commented 3 years ago

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 commented 3 years ago

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.

LiamDormon commented 3 years ago

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

Rosw3lluk commented 3 years ago

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.

LiamDormon commented 3 years ago

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

Rosw3lluk commented 3 years ago

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

LiamDormon commented 3 years ago

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.

Rosw3lluk commented 3 years ago

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

LiamDormon commented 3 years ago

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

Rosw3lluk commented 3 years ago

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 commented 3 years ago

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 😕

TheeDeer commented 3 years ago

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

PhilsBadMan commented 3 years ago

ditto

NikolaiFN commented 3 years ago

ditto

Same issue here.

Rosw3lluk commented 3 years ago

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 commented 3 years ago

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,

NikolaiFN commented 3 years ago

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.

TheeDeer commented 3 years ago

@Mojito-Fivem Done

ArcadiusMachine commented 3 years ago

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..

LiamDormon commented 3 years ago

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

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

to the function and seems to fix the issue.

ArcadiusMachine commented 3 years ago

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

LiamDormon commented 3 years ago

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

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

ArcadiusMachine commented 3 years ago

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

LiamDormon commented 3 years ago

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

No.