Installation

Note: This script can be used with any framework since it has no dependencies.

General

Basic Installation

  1. Download the script from the FiveM Asset Manager.

  2. Extract the visn_are.pack.zip-archive into your resources folder.

  3. Rename visn_are.pack to visn_are.

  4. Open the configuration folder inside the visn_are-folder.

  5. Customize the client_config.lua and server_config.lua to your needs.

  6. Start the script.

ESX Integration

esx_ambulancejob integration

If you are using esx_ambulancejob go into esx_ambulancejob/client/main.lua and replace:

esx_ambulancejob\client\main.lua
AddEventHandler('esx:onPlayerSpawn', function()
	isDead = false
	
	if firstSpawn then
		firstSpawn = false
	
		if Config.SaveDeathStatus then
			while not ESX.PlayerLoaded do
				Wait(1000)
			end
	
			ESX.TriggerServerCallback('esx_ambulancejob:getDeathStatus', function(shouldDie)
				if shouldDie then
					Wait(1000)
					SetEntityHealth(PlayerPedId(), 0)
				end
			end)
		end
	end
end)

function OnPlayerDeath()
    isDead = true
    ESX.UI.Menu.CloseAll()
    TriggerServerEvent('esx_ambulancejob:setDeathStatus', true)

    StartDeathTimer()
    StartDistressSignal()

    StartScreenEffect('DeathFailOut', 0, false)
end

Command Implementation

To integrate the revive command, please do the following:

  1. Open the file server/main.lua inside the esx_ambulancejob-folder and search for the command "revive" and replace it with following code.

server/main.lua
TriggerEvent('es:addGroupCommand', 'revive', 'admin', function(source, args ,user)
    if args[1] ~= nil then
        if GetPlayerName(tonumber(args[1])) ~= nil then
            TriggerClientEvent('esx_ambulancejob:revive', tonumber(args[1]))
            TriggerClientEvent('visn_are:resetHealthBuffer', tonumber(args[1]))
        end
    else
        TriggerClientEvent('esx_ambulancejob:revive', source)
        TriggerClientEvent('visn_are:resetHealthBuffer', source)
    end
end, function(source, args, user)
    TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient permissions.'}})
end, { help = _U('revive_help'), params = {{ name = 'id'}}})

QBCore Integration

qb-ambulancejob Integration

If you are using qb-ambulancejob go into qb-ambulancejob/fxmanifest.lua and remove the following lines from client_scripts:

'client/wounding.lua'
'client/laststand.lua'
'client/dead.lua'

Command Implementation

To integrate the revive command, please do the following:

  1. Open the file server/main.lua inside the qb-ambulancejob-folder and search for the command "revive" and replace it with following code.

server/main.lua

QBCore.Commands.Add("revive", Lang:t('info.revive_player_a'), {{name = "id", help = Lang:t('info.player_id')}}, false, function(source, args)
	local src = source
	if args[1] then
		local Player = QBCore.Functions.GetPlayer(tonumber(args[1]))
		if Player then
			TriggerClientEvent('hospital:client:Revive', Player.PlayerData.source)
			TriggerClientEvent('visn_are:resetHealthBuffer', Player.PlayerData.source)
		else
			TriggerClientEvent('QBCore:Notify', src, Lang:t('error.not_online'), "error")
		end
	else
		TriggerClientEvent('hospital:client:Revive', src)
		TriggerClientEvent('visn_are:resetHealthBuffer', src)
	end
end, "admin")

Standalone Integration

This script works out of the box for standalone. If you want to integrate custom framework things, have a look inside visn_are/script/helpers/s_functions.lua.

Revive Command

A revive command is included in the script. You can enable it in the Server Config. In order to customize the permissions for it have a look inside visn_are/script/helpers/s_functions.lua.

Last updated