Page cover image

Installation

Installing this resource is like any other resource only verified that you have the required dependencies

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

Go to the Granted Assets category and download the most recent version of the Property Creator

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

refresh
ensure Var-Property

Step 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
    )
end

Last updated