π Ambulance Setup
When a player is inside a shell or IPL, their real coordinates are inside the instanced interior, far from where the property is on the map. Make your ambulance script use the property entrance instead, so medics are sent to the right place.
You need two changes in your ambulance script:
- The distress call uses
GetEnterCoordinatesinstead of the player's coordinates. - The respawn calls
ForceExitPlayer, so the player leaves the property when they respawn at the hospital.
esx_ambulancejob/server/main.lua
qb-ambulancejob/server/main.lua
qbx_ambulancejob/server/main.lua
How it works
GetEnterCoordinatesreturns the entrance of the property the player is in. For a property inside a building, it returns the building entrance. It returnsfalsewhen the player isn't in a property, soor GetEntityCoords(ped)falls back to their normal position.ForceExitPlayermoves the player out of the property, the same as walking out of the door. It does nothing if they aren't in one.