⚙️
veryinsanee.space
  • Welcome!
  • Store
  • Advanced Roleplay Environment
    • Installation
    • Guides
      • Basic Gameplay Guide
        • Medications
        • Wounds & Bandages
        • Blood Loss, IVs, Stabilzation
        • Surgical Kit & Emergency Revive Kit
        • Cardiac Arrest & CPR
        • Mass-Casualty Incidents & Triage
        • Heart Rate & Blood Pressure
      • Basic Configuration Guide
        • Client Configuration
        • Server Configuration
      • Advanced Configuration Guide
        • Adding injuries
        • Adding damage types
        • Adding medications
        • Adding bandages
        • Adding infusions
        • Adding menu actions
    • API Reference
    • Plugin Support
  • veryinsanee's Whitelist
    • Installation
Powered by GitBook
On this page
  • General
  • Basic Installation
  • ESX Integration
  • esx_ambulancejob integration
  • Command Implementation
  • QBCore Integration
  • qb-ambulancejob Integration
  • Command Implementation
  • Standalone Integration
  • Revive Command

Was this helpful?

  1. Advanced Roleplay Environment

Installation

PreviousWelcome!NextGuides

Last updated 5 months ago

Was this helpful?

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

General

Basic Installation

  1. Download the script from the .

  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
esx_ambulancejob\client\main.lua
AddEventHandler('esx:onPlayerSpawn', function()
    isDead = false
end)

function OnPlayerDeath()
    ESX.UI.Menu.CloseAll()
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'}}})
server/main.lua
ESX.RegisterCommand('revive', 'admin', function(xPlayer, args, showError)
    args.playerId.triggerEvent('esx_ambulancejob:revive')
    args.playerId.triggerEvent('visn_are:resetHealthBuffer')
end, true, {help = _U('revive_help'), validate = true, arguments = { {name = 'playerId', help = 'The player id', type = 'player'} }})

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.

FiveM Asset Manager
The console output should look like this if you have done everything correct.