mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 08:13:21 +00:00
Merge pull request #1157 from esx-framework/patch-2
Handle setMeta subvalue
This commit is contained in:
@@ -4,8 +4,8 @@ on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
pull_request:
|
||||
types:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
|
||||
jobs:
|
||||
@@ -15,14 +15,9 @@ jobs:
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
- name: Get event creation date
|
||||
- name: Get current date
|
||||
id: date
|
||||
run: |
|
||||
if [[ "${{ github.event_name }}" == "issues" ]]; then
|
||||
echo "date=${{ github.event.issue.created_at }}" >> $GITHUB_ENV
|
||||
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||
echo "date=${{ github.event.pull_request.created_at }}" >> $GITHUB_ENV
|
||||
fi
|
||||
run: echo "date=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
|
||||
- name: Add to project
|
||||
uses: actions/add-to-project@v0.5.0
|
||||
with:
|
||||
@@ -35,5 +30,5 @@ jobs:
|
||||
project-url: https://github.com/orgs/esx-framework/projects/9
|
||||
github-token: ${{ secrets.MY_GITHUB_TOKEN }}
|
||||
item-id: ${{ steps.add-project.outputs.itemId }}
|
||||
field-keys: Date
|
||||
field-values: ${{ env.date }},
|
||||
field-keys: Date,Priority
|
||||
field-values: ${{ env.date }},Unrealised
|
||||
@@ -473,7 +473,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
for _, v2 in ipairs(v.components) do
|
||||
self.removeWeaponComponent(weaponName, v2)
|
||||
end
|
||||
|
||||
|
||||
local weaponHash = joaat(v.name)
|
||||
|
||||
RemoveWeaponFromPed(playerPed, weaponHash)
|
||||
@@ -643,6 +643,10 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
return print(("[^1ERROR^7] xPlayer.setMeta ^5value^7 should be ^5string^7 as a subIndex!"):format(value))
|
||||
end
|
||||
|
||||
if not self.metadata[index] or type(self.metadata[index]) ~= "table" then
|
||||
self.metadata[index] = { }
|
||||
end
|
||||
|
||||
self.metadata[index][value] = subValue
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user