-
Notifications
You must be signed in to change notification settings - Fork 19
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
[bug] Clients disappears and being selected the same one as before #33
Comments
@iSentrie I tested it now and it does not select the same NPC, so it never goes into the unconscious if branch. It always selects another one nearby. How can we reproduce this? |
Not always, but most often it will just select the same one, especially if there are not so many other peds nearby, without any efforts or specific repro. Script has to select the same one just question of time, because it doesn't track if the ped was your customer or not. |
I think things are mixed up here, so when you write this the specific ped is corrupted so by default the ped being set twice the same wouldn't be a problem, not pretty of course but it's not bugg. This message appears when you find an NPC that is damaged. It's probably because if it's damaged it wouldn't be controllable, although you could "revieve" it and it would work. However, for me, out of 10/10 cases, it always found something else, never the same, so I could not reproduce it. |
You're super lucky if you haven't got this bug from 10 attempts. This happens: Lines 581 to 585 in 1958dcb
And that happens because it's never checked if the ped was your customer or not: Lines 42 to 55 in 1958dcb
Step towards solution could be something like this: -- check current customer vs new customer, however this has to be improved and CurrentCustomer saved so it wouldn't reset
if CurrentCustomer ~= peds[i] and IsPedHuman(peds[i]) and IsPedWalking(peds[i]) and not IsPedAPlayer(peds[i]) then
search[#search+1] = peds[i]
end I haven't looked in to it much, but pretty sure CurrentCustomer will reset when aborting the mission, so it still can be bugged out this way, so probably should declare this NPC ped id's at a different name and check this against ped that gonna be found by script as new customer. |
@iSentrie Yes I believe this happens, but it hasn't been reproduced yet and as you say it resets the whole mission that will be the problem. With a couple of checks we can fix this as soon as I can reproduce the basic problem. |
Pick up in Los Santos, deliver to Sandy Shores, it's basically over 50% that this will happen, at least for me. |
@iSentrie I checked and now there was a case where it found that NPC but I only managed to trigger it when I interrupted the job and asked for a new job, but I still didn't get the unconcius notifiy. I have two questions: My other question is that the PED was not damaged because as I look at the code there is an IsPedFatallyInjured native call that checks if the NPC is not damaged, otherwise it doesn't go into the condition. Thanks for the replies, I might be able to reproduce it in the end (I hope :)) |
@iSentrie Now I see that you use the GTA notification while I use the ESX ShowNotification and this script uses it too, of course you may have rewritten your own but I only managed to display this notification if I kill the NPC in the taxi because then the thread detects that it is damaged and stops the transport logic and starts searching again. Is it possible that you are using some other script? It's quite weird because I've done it about 20 times now and it always finds something else and since the ped is not damaged it never goes into the IF. |
I have modified the framework for my needs, but taxi script was 1:1 when I tested. If you get same ped it will be deleted by script and it will count as unconscious. local function scope(customer)
ESX.SetTimeout(60000, function()
DeletePed(customer)
end)
end I don't really remember how I was doing it exactly through F6 or not, probably not, since script doesn't really check for that, so it doesn't really matter you cancel it or not. |
There is a bug in the script when after dropping off the client, he's selected again as new customer and very soon after he gets in, he vanishes. Causing this to bug out.
Same problem was here: #32
The text was updated successfully, but these errors were encountered: