It’s not randomly, as I said, I updated accordingly to what you asked, it will look at the config.lua and see the coords to the hospitals/morgue/etc you wrote in Config.HospitalLocations
, then teleport him to the closest one.
Here’s a snippet (Not the entire TP logic) to clear things up, I tested this multiple times, and in my testing it correctly teleported the player to the relevant closest coord, so you can add more coords to the config.lua and it will be more varied.
local playerPed = PlayerPedId()
local closestCoords = nil
local closestDistance = math.huge
for _, location in ipairs(Config.HospitalLocations) do
local distance = #(deathCoords - location.coords)
if distance < closestDistance then
closestDistance = distance
closestCoords = location.coords
end
end
Config.HospitalLocations = {
{name = "LS Morgue", coords = vec3(238.6728, -1381.861, 33.73852)},
{name = "Paleto Bay Care", coords = vec3(-244.9511, 6333.368, 32.48932)},
-- Add more locations here
}
1 Like
is it possible to simply have the ped corpses of players taken away?
for example, the ambulance job can also drive the hearse and put the ped on the stretcher and take it to location X and possibly even get a reward for it as an example.
1 Like
Hey! Hope it has been a great year for you!
I could think of doing this way also, It’s not a bad idea, just that it would involve a re-write of a part of functions and some added framework support that cost some time, maybe in the near future I can plan this idea and begin some testings. I’m off coding for now, but in January I’ll be returning to all my projects.
This resource is an active development, so It will have more improvements and updates moving on!
As of now, Player x Player and Player x NPC
will still be treated as shown in the previews, to simulate the action of the bodybag and “carrying” it to the coroner vehicle.
1 Like
Could we add a blacklisted peds option? So this way we can put in the spawn codes of peds (animals in our case) that we dont want to be allowed to use body bag or blanket. (We have a hunting system thats why)
1 Like
I’ll look into adding this later when I get some time, thanks for the feedback
1 Like
Asset Updated!
Now it has list of blacklisted model hashes in the config.lua that will not show the target interaction to place the bodybag.
Config.BlacklistedModels = {
GetHashKey("a_c_deer"), -- Example: Deer
GetHashKey("a_c_coyote"), -- Example: Coyote
-- Add more model hashes here.
}
1 Like
I Love it! Just wish for my self more open functions. The Base thing can be escrowed like before but ox_target and the job things needs to be open. Also maybe spawn and delete npc + vehicle.
1 Like
Thanks for you feedback! I’m happy that you liked.
I’m off from my pc as of now, but as soon as I get back, I’ll be working on opening more the target/job configuration as per request.
As about the npc and vehicle, they already disappear after wandering away some time configured in the config.lua:
Config.VehicleWaitTime = 20000 -- Time in milliseconds for how long the vehicle drives before despawning
Are you talking about spawning them in another way?
1 Like
No no, my friend, I mean functions.
For example, something like sending a message when someone gets deleted, a dispatch event, or anything similar. Just more functions to handle more tasks within the systems.
But it’s all good.
Just one more thing: The vehicle drives very, very close to the dead ped—maybe 2-3 meters less. 
1 Like
I see, ok then.
About the stopping distance, it’s configurable in the config.lua as well, just modify the values greater than what they are in the last asset release you download
– Vehicle Distances
Config.VehicleStopDistance = – Distance at which the vehicle stops from the bodybag
1 Like
About the moving over some parts, it’s already in the works, it will have both client_noescrow.lua and server_noescrow.lua which will have some necessary functions and overral code to mess and change within your desire and needs, it will come in a future update.
1 Like
Hello Major,
We’re using your script actively but we have encountered slight issue when using wasabi_ambulance.
When user dies he is respawned and added to certain animation (seems like most of the ambulance scripts do it).
But this causes the bodybag function to not show up as it shows the player is “alive” I think.
Could you do any twerks for this somehow otherwize we have to literally use “kill” and we have 2 seconds to bodybag the player before hes re-spawned with the death anim on the floor.
1 Like
Sorry for theses issues happening to you, I overlooked and forgot to code in a way to not bug while using ambulance/medical resources, I’m going to hotfix this asap and provide you with udpated asset.
When I’m finished, you will be notified here with another reply
Pushed a hotfix, report back if you have any issues. Sorry for this bug.
1 Like
Doesn’t show at all anymore in the target menu.
ah. I’m gonna take a longer time then to see how I can manage to fix this. Reverting the change so you have at lease a functional case.
Reverted the changes, I’ll update after I rework to solve this. Re-download the resource.
Hello,
Any update on this matter?
1 Like
Hi, I’m sorry, got busy with my college tests, I have then worked on it after I finished my tests, and tried to include support to wasabi and other ambulance resources, this time with a more extensive update. I’ve tried to get more info about wasabi and another ambulance resources, so now it should work the way you wanted.
Re-download the asset.
And again, Sorry for the delays, errors, I’m a solo developer and do not have anyone helping me, so it takes more time.