Merge pull request #1157 from esx-framework/patch-2

Handle setMeta subvalue
This commit is contained in:
Gellipapa
2023-08-17 23:44:33 +02:00
committed by GitHub
2 changed files with 11 additions and 12 deletions
+6 -11
View File
@@ -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
+5 -1
View File
@@ -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