How i can fix so Ambulance can lift people

Hi, anyone who knows how to fix / code so that the ambulance can take and
lift people

I am unsure if anything like that exists… ill see if I can whip up something and I can PM it to ya.

can it be a release?

This might work? It’s been sitting in my folder for years… If it works, please don’t redistribute as yours. If it doesn’t and you get it working, let me know so I can edit this post accordingly.


Citizen.CreateThread(function()
	if IsControlJustPressed(1, 58) then
	if IsPedInAnyVehicle(GetPlayerPed(-1), true) then
			TriggerEvent('GetInAmbulance')
		end
	end
end)


AddEventHandler('GetInAmbulance', function()
TriggerEvent('GetInAmbulance')
	local victim = GetPlayerPed(-1)
	local coordA = GetEntityCoords(playerped, 1)
	local coordB = GetOffsetFromEntityInWorldCoords(playerped, 0.0, 5.0, 0.0)
	local ambulance = getVehicleInDirection(coordA, coordB)
	
		if not IsPedInAnyVehicle(victim, true) then
			local ambulance = getVehicleInDirection(4.0)
			if GetEntityModel(ambulance) == GetHashKey("ambulance") then
				TaskEnterVehicle(victim, ambulance, 6, 2, 1.0, 2, 0)
			end
		end
end)


function getVehicleInDirection(coordFrom, coordTo)
	local rayHandle = CastRayPointToPoint(coordFrom.x, coordFrom.y, coordFrom.z, coordTo.x, coordTo.y, coordTo.z, 10, GetPlayerPed(-1), 0)
	local a, b, c, d, vehicle = GetRaycastResult(rayHandle)
	return vehicle
end

hi you can send pm to me on discord Johan Falk / SoftissXibit # 8915

No. You can release it here. If you ask for stuff here, it’s more than obvious that you should also share the solution/work here. If you want private work, do that via some other site or contact method. But don’t request private work here.

okey sorry

how would i import this to a script?

What does this snippet do and how would i apply it to my ambulance script? :slight_smile:

This snippet would allow individuals to enter the rear of the ambulance. You would need to learn Lua and understand it’s application to apply it to your resource. Being that this is a 3 year old thread, I am sure that there are updated ambulance resources that apply this logic in a better fashion.

Man im having a hard time finding a good ambulance script at the moment and my lua knowledge is lacking. Are you able to help me with something? I feel like it would very easy i just dont have the knowledge.