From a14e1d208fd8f05b2ebe815d731a9ee786ad600a Mon Sep 17 00:00:00 2001 From: Mycroft Date: Fri, 26 Aug 2022 17:12:41 +0100 Subject: [PATCH] feat: esx_property: serversided key strings --- [esx_addons]/esx_property/locales/en.lua | 13 ++++++++++++- [esx_addons]/esx_property/server/main.lua | 12 ++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/[esx_addons]/esx_property/locales/en.lua b/[esx_addons]/esx_property/locales/en.lua index 3ded01d6..2d76fa3a 100644 --- a/[esx_addons]/esx_property/locales/en.lua +++ b/[esx_addons]/esx_property/locales/en.lua @@ -1,5 +1,7 @@ Locales['en'] = { + --- CCTV Strings ------ + ["take_picture"] = "Take Picture", ["rot_left_right"] = "Left/Right", ["rot_up_down"] = "Up/Down", @@ -44,5 +46,14 @@ Locales['en'] = { ["furni_reset_success"] = "Furniture Reset!", ["furni_cannot_afford"] = "You Cannot Afford Todo this!", ["furni_reset_error"] = "You ~r~Cannot~s~ Reset This Property!", - ["furni_management"] = "Manage Furniture" + ["furni_management"] = "Manage Furniture", + + --------- Key Strings --------------- + + ["you_granted"] = 'You Have Been Granted Keys To ~b~%s~s~.', + ["already_has"] = "This Player Already Has Keys!", + ["do_not_own"] = 'You do ~r~not~s~ own this property.', + ["key_revoked"] = 'Your Key Access To ~b~%s~s~. Has Been ~r~Revoked~s~', + ["no_keys"] = "This Player Does Not Have Keys!" + } \ No newline at end of file diff --git a/[esx_addons]/esx_property/server/main.lua b/[esx_addons]/esx_property/server/main.lua index 7a3905c1..d6cdcc6b 100644 --- a/[esx_addons]/esx_property/server/main.lua +++ b/[esx_addons]/esx_property/server/main.lua @@ -805,15 +805,15 @@ ESX.RegisterServerCallback('esx_property:GiveKey', function(source, cb, property local id = xTarget.identifier if not Properties[property].Keys[id] then Property.Keys[id] = {name = xTarget.getName(), identifier = id} - xTarget.showNotification('You Have Been Granted Keys To ~b~' .. Property.Name .. '~s~.', 'success') + xTarget.showNotification(_U("you_granted", Property.Name), 'success') xTarget.triggerEvent("esx_property:giveKeyAccess") cb(true) else - xPlayer.showNotification('This Player Already Has Keys To ~b~' .. Property.Name .. '~s~.', 'error') + xPlayer.showNotification(_U("already_has"), 'error') cb(false) end else - xPlayer.showNotification('You do ~r~not~s~ own this property.', 'error') + xPlayer.showNotification(_U("do_not_own"), 'error') cb(false) end Log("Property Key Given", 3640511, @@ -902,18 +902,18 @@ ESX.RegisterServerCallback('esx_property:RemoveKey', function(source, cb, proper {{name = "**Property Name**", value = Property.Name, inline = true}, {name = "**Owner**", value = xPlayer.getName(), inline = true}, {name = "**Removed From**", value = tostring(Properties[property].Keys[player].name), inline = true}}, 3) Properties[property].Keys[player] = nil - xTarget.showNotification('Your Key Access To ~b~' .. Property.Name .. '~s~. Has Been ~r~Revoked~s~', 'error') + xTarget.showNotification(_U("key_revoked", Property.Name), 'error') xTarget.triggerEvent("esx_property:RemoveKeyAccess", property) cb(true) else - xPlayer.showNotification('This Player Does Not Have Keys To ~b~' .. Property.Name .. '~s~.', 'error') + xPlayer.showNotification(_U("no_keys"), 'error') cb(false) end else cb(false) end else - xPlayer.showNotification('You do ~r~not~s~ own this property.', 'error') + xPlayer.showNotification(_U("do_not_own"), 'error') cb(false) end end)