Visn Are
This guide walks you through the installation and configuration process for our Deathscreen script. Before proceeding, ensure you've followed the general script setup steps outlined in the general installation guide.
General Installation Guide
Add Export
Add this line at the bottom of helpers/c_functions.lua
in visn_are
:
visn_are/helpers/c_functions.lua
exports("RespawnPlayer", function()
RespawnPlayer(ClientData.coords, TempAuthToken)
end)
Remove Native Death Screen
Locate window.addEventListener
in html/app.js
and comment out toggleUnconsciousScreen
like this:
visn_are/html/app.js
case "forcedUpdateBodyPartInformation":
_showInjuries(selectedBodyPart, _getBodyPartInjuries(selectedBodyPart));
_getAvailableActionsForCategory(lastActionCategory, selectedBodyPart);
break;
case "toggleTriageSelection":
event.data.payloadData ? $(".triageSelection").show() : $(".triageSelection").hide();
// case "toggleUnconsciousScreen":
// if (event.data.payloadData.value) {
// $(".remaining_time").hide();
// $(".remaining_time").text(`00:00 ${_translateText("MINUTES_REMAINING")}`);
// }
// event.data.payloadData.value ? $(".unconsciousScreen").fadeIn("fast") : $(".unconsciousScreen").fadeOut("fast");
// break;
case "toggleAnesthesiaScreen":
event.data.payloadData.value ? $(".anesthesiaScreen").fadeIn("fast") : $(".anesthesiaScreen").fadeOut("fast");
break;
case "updateUnconsciousTime":
const minutes = Math.floor(event.data.payloadData.seconds / 60);
$(".remaining_time").text(`${minutes.toString().padStart(2, "0")}:${(event.data.payloadData.seconds % 60).toString().padStart(2, "0")} ${_translateText("MINUTES_REMAINING")}`);
$(".unconsciousScreen .progressbar").css("width", event.data.payloadData.seconds / event.data.payloadData.max_seconds * 100 + "%");
if ($(".remaining_time").css("display") == "none") $(".remaining_time").fadeIn("fast");
break;
Remove Native Deathscreen Logic
Locate the function HandleUnconsciousScreen(bloodVolume)
in c_functions.lua
and comment out all lines within the function, like so:
visn_are/helpers/c_functions.lua
function HandleUnconsciousScreen(bloodVolume)
-- local remainingSeconds = GetRemainingUnconsciousSeconds(ClientHealthBuffer)
--
-- SendNUIMessage({
-- payload = "updateUnconsciousTime",
-- payloadData = {
-- seconds = remainingSeconds,
-- max_seconds = ClientHealthBuffer.unconsciousTimeUntilDeath
-- }
-- })
--
-- if GetGameTimer() - LastDispatch > ClientConfig.m_emergencyDispatch.cooldown * 1000 and LastDispatchHidden then
-- SendNUIMessage({
-- payload = "toggleDispatchInfo",
-- payloadData = {
-- value = (ClientConfig.m_emergencyDispatch.enabled and ClientConfig.m_configurableKeys.keys.EMERGENCY_DISPATCH.enabled) and not ClientHealthBuffer.bodybag,
-- key = ClientConfig.m_configurableKeys.m_useInputMapper
-- and GetControlStringFromKeyMapping("emergency_dispatch")
-- or GetControlStringFromKeyMappingNoInputMapper(ClientConfig.m_configurableKeys.keys.EMERGENCY_DISPATCH.control_id)
-- }
-- })
--
-- LastDispatchHidden = false
-- end
--
-- if not CheckForCriticalVitals(bloodVolume) and math.random(0, 100) > 75 and
-- (
-- ClientHealthBuffer.heartRate > 50 and
-- ClientHealthBuffer.bloodVolume > ENUM_BLOOD_VOLUME_CLASSES.CLASS_4_HERMORRHAGE) then
-- SetUnconsciousState(false)
-- end
--
-- if ClientHealthBuffer.unconscious and remainingSeconds == 0 then
-- if ClientConfig.m_allowManualRespawnWhileBeingUnconscious then
-- SendNUIMessage({
-- payload = "showManualRespawnText",
-- payloadData = {
-- value = ClientConfig.m_configurableKeys.keys.MANUAL_RESPAWN.enabled,
-- key = ClientConfig.m_configurableKeys.m_useInputMapper
-- and GetControlStringFromKeyMapping("manual_respawn")
-- or GetControlStringFromKeyMappingNoInputMapper(ClientConfig.m_configurableKeys.keys.MANUAL_RESPAWN.control_id)
-- }
-- })
-- else
-- RespawnPlayer(ClientData.coords, TempAuthToken)
-- end
-- end
end
Support
Need help? Our support team is always ready to assist
Join DiscordOSP Ambulance
This guide walks you through the installation and configuration process for our Deathscreen script. Before proceeding, ensure you've followed the general script setup steps outlined in the general installation guide.
QBCore Integration
This guide documents the installation for our Drivingschool with full QB City Hall integration.