qbcore-framework / qb-policejob

Police Job & Evidence System For QB-Core :police_officer: :policewoman:
GNU General Public License v3.0
71 stars 376 forks source link

[BUG] On/Off Duty doesnt work correctly when you don't use Target #387

Closed CptNoHand closed 2 years ago

CptNoHand commented 2 years ago

Describe the bug We don't use Target atm and DrawText for the duty location shows as inteded, but you can move 10 or more meters away and when you press E und again you again toggle duty.

Steps to reproduce the behavior:

  1. Go to duty location
  2. Toggle duty
  3. go few feet away till it disappears wait till notify goes away
  4. you toggle duty again, even when the drawtext isnt showing anymore

Expected behavior To not toggle after drawtext disappears

Questions (please complete the following information):

singh-manavv commented 2 years ago

Just decrease the distance of the BoxZone of duty zone .

CptNoHand commented 2 years ago

The problem is, even if i'm technically out of the zone, i can still toggle duty for a while.--Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.Am 11.09.22, 05:14 schrieb Manav Singh @.***>:

Just decrease the distance of the BoxZone of duty zone . —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

singh-manavv commented 2 years ago

Make sure the length and width of box zone is small , and distance is also like 1 or 1.5 , ypu will be good to go

i-kulgu commented 2 years ago

The problem is, even if i'm technically out of the zone, i can still toggle duty for a while.

Do you still face this problem or is it solved already ?

CptNoHand commented 2 years ago

Still happening. I made the zone smaller, but that isn't the problem. As soon as you walk too close past it and it comes up, the next time you press "E" you toggle it.

tom-osborne commented 2 years ago

@CptNoHand This can be fixed by changing the following line: https://github.com/qbcore-framework/qb-policejob/blob/main/client/job.lua#L821

From:

            inDuty = false
            dutylisten = false

I'll get a PR raised.