esx_datastore

MLO-uri, interioare, hărți optimizate și asset-uri pentru stream.
Post Reply
User avatar
greenie
Full Member
Full Member
Posts: 4444
Joined: Sun Nov 21, 2021 4:55 pm
Jucator SA:MP ?: Nu
Nick:: greenie
Jucator CS ?: Da

esx_datastore

Post by greenie »

https://github.com/esx-framework/ESX-Le ... _datastore

This script, is similar to esx_addoninventory but stores overall data, rather than inventory specific data.

Usage
There is two types of datastores: shared and not shared.

Shared datastores doesn’t belong to a specific user. Example: police armory
None-shared datastores are created for every user in the server. They are created in db when player is loaded, Example: esx_property outfits.
Database Information
A datastore must be configured in the database before using it. you must run a server restart after this.

Table Structure

name
type: string
description: name of the datastore
label
type: string
description: label of the datastore (not used)
shared
type: boolean
description: is the datastore shared with others? (boolean either 0 or 1)
API
getInventory
Event: esx_datastore:getDataStore
Usage: TriggerEvent('esx_datastore:getDataStore', name, owner, function)
Example:
TriggerEvent('esx_datastore:getDataStore', 'property', 'steam:0123456789', function(store)
local dressing = store.get('dressing') or {}
end)
getSharedInventory
Event: esx_datastore:getSharedDataStore
Usage: TriggerEvent('esx_datastore:getSharedDataStore', name, function)
Example:
TriggerEvent('esx_datastore:getSharedDataStore', 'police', function(store)
local weapons = store.get('weapons') or {}
table.insert(weapons, {name = 'WEAPON_PUMPSHOTGUN', ammo = 50})
store.set('weapons', weapons)
end)
𝑴𝒂𝒚𝒃𝒆 𝒕𝒉𝒆 𝑬𝒂𝒓𝒕𝒉 𝒊𝒔 𝒕𝒉𝒆 𝑯𝒆𝒍𝒍 𝒐𝒇 𝑨𝒏𝒐𝒕𝒉𝒆𝒓 𝑷𝒍𝒂𝒏𝒆𝒕... ☢️

✅ GAZDUIRE JOCURI / VPS / GAZDUIRE WEB / SERVERE DEDICATE - Stock NELIMITAT / Valabil comandati pe https://www.zonek.ro/
Post Reply

Return to “Server Resources”