
Installation
Step 1
Connect via this site: https://keymaster.fivem.net/ with your CFX account to which your purchase was made on the store https://www.var-fivem.com/
Step 2

Step 3
As this script requires a database you must insert the SQL into it, if you have some problems with SQL insertion please import it directly by the button import and click on the button "choose a file"

Step 4
Once the download is complete, unzip the file and drag it into the resources folder of your server
If you added the resource while your server was already running, remember to do the refresh command and then ensure the resource
refreshensure Var-PropertyStep 5
To resolve the issue where you get stuck inside a property after leaving the server and reconnecting, follow these steps.
Replace the function "Core.SavePlayer" -> es_extended/server/functions.lua by this one
function Core.SavePlayer(xPlayer, cb)
if not xPlayer.spawned then
return cb and cb()
end
updateHealthAndArmorInMetadata(xPlayer)
local parameters = {
json.encode(xPlayer.getAccounts(true)),
xPlayer.job.name,
xPlayer.job.grade,
xPlayer.group,
json.encode(xPlayer.getInventory(true)),
json.encode(xPlayer.getLoadout(true)),
json.encode(xPlayer.getMeta()),
xPlayer.identifier,
}
local sql = "UPDATE `users` SET `accounts` = ?, `job` = ?, `job_grade` = ?, `group` = ?, `inventory` = ?, `loadout` = ?, `metadata` = ? WHERE `identifier` = ?"
if not ServerSavePlayers[xPlayer.identifier] then
local playerPosition = json.encode(xPlayer.getCoords(false, true))
table.insert(parameters, 5, playerPosition)
sql = "UPDATE `users` SET `accounts` = ?, `job` = ?, `job_grade` = ?, `group` = ?, `position` = ?, `inventory` = ?, `loadout` = ?, `metadata` = ? WHERE `identifier` = ?"
end
MySQL.prepare(
sql,
parameters,
function(affectedRows)
if affectedRows == 1 then
print(('[^2INFO^7] Saved player ^5"%s^7"'):format(xPlayer.name))
TriggerEvent("esx:playerSaved", xPlayer.playerId, xPlayer)
end
if cb then
cb()
end
end
)
endReplace the function "Core.SavePlayer" -> es_extended/server/functions.lua by this one :
function Core.SavePlayer(xPlayer, cb)
local parameters = {
json.encode(xPlayer.getAccounts(true)),
xPlayer.job.name,
xPlayer.job.grade,
xPlayer.group,
json.encode(xPlayer.getInventory(true)),
json.encode(xPlayer.getLoadout(true)),
json.encode(xPlayer.getMeta()),
xPlayer.identifier
}
local sql = 'UPDATE `users` SET `accounts` = ?, `job` = ?, `job_grade` = ?, `group` = ?, `inventory` = ?, `loadout` = ?, `metadata` = ? WHERE `identifier` = ?'
if not ServerSavePlayers[xPlayer.identifier] then
table.insert(parameters, 5, json.encode(xPlayer.getCoords()))
sql = 'UPDATE `users` SET `accounts` = ?, `job` = ?, `job_grade` = ?, `group` = ?, `position` = ?, `inventory` = ?, `loadout` = ?, `metadata` = ? WHERE `identifier` = ?'
end
MySQL.prepare(
sql,
parameters,
function(affectedRows)
if affectedRows == 1 then
print(('[^2INFO^7] Saved player ^5"%s^7"'):format(xPlayer.name))
TriggerEvent('esx:playerSaved', xPlayer.playerId, xPlayer)
end
if cb then
cb()
end
end
)
endAnd add this event where you want in es_extended/server/functions.lua
ServerSavePlayers = {}
RegisterServerEvent("Property:CanSave")
AddEventHandler("Property:CanSave", function(bool, identifier)
ServerSavePlayers[identifier] = bool
end)
Last updated