From 4f1f3f044223fe9d3c1836660592c4cf53aa5e36 Mon Sep 17 00:00:00 2001 From: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Tue, 19 Jul 2022 23:09:39 +0200 Subject: [PATCH] feat - esx_context functions --- [esx]/es_extended/client/functions.lua | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/[esx]/es_extended/client/functions.lua b/[esx]/es_extended/client/functions.lua index ddeb89d3..5f490858 100644 --- a/[esx]/es_extended/client/functions.lua +++ b/[esx]/es_extended/client/functions.lua @@ -147,6 +147,33 @@ ESX.HashString = function(str) return input_map end +if GetResourceState("esx_context") ~= "missing" then + + function ESX.OpenContext(...) + exports["esx_context"]:Open(...) + end + + function ESX.PreviewContext(...) + exports["esx_context"]:Preview(...) + end + + function ESX.CloseContext(...) + exports["esx_context"]:Close(...) + end +else + function ESX.OpenContext() + print("[ERROR] ESX Context Not Found") + end + + function ESX.PreviewContext() + print("[ERROR] ESX Context Not Found") + end + + function ESX.CloseContext() + print("[ERROR] ESX Context Not Found") + end +end + ESX.RegisterInput = function(command_name, label, input_group, key, on_press, on_release) RegisterCommand(on_release ~= nil and "+" .. command_name or command_name, on_press)