diff --git a/.github/workflows/format-all.yml b/.github/workflows/format-all.yml new file mode 100644 index 00000000..b94e1342 --- /dev/null +++ b/.github/workflows/format-all.yml @@ -0,0 +1,43 @@ +name: formatter-all + +on: + push: + branches: [ main ] + pull_request: + types: [ labeled ] + +jobs: + formatter: + name: formatter + runs-on: ubuntu-latest + permissions: + contents: write + if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.label.name == 'format_all') }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + node-version: "16" + - name: Install stylua and format files + uses: JohnnyMorganz/stylua-action@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: v0.18.0 + args: -- . + - name: Format files with Prettier + run: | + npx prettier --write '**/*.{ts,js,css,html}' + - name: Update repo before push + run: | + git pull + - name: Commit changes and push current branch + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_user_name: ESX GITHUB ACTIONS BOT + commit_user_email: esx-github-actions-bot@users.noreply.github.com + commit_message: :art:Code formatted in all files diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..b75c6ea4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,39 @@ +name: Add issue or pull request to project board + +on: + issues: + types: + - opened + pull_request: + types: + - opened + +jobs: + add-to-project: + name: Add issue or pull request to project + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + - name: Get event creation 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 + - name: Add to project + uses: actions/add-to-project@v0.5.0 + with: + project-url: https://github.com/orgs/esx-framework/projects/9 + github-token: ${{ secrets.MY_GITHUB_TOKEN }} + id: add-project + - name: Update project fields + uses: titoportas/update-project-fields@v0.1.0 + with: + 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 }}, \ No newline at end of file diff --git a/[core]/cron/fxmanifest.lua b/[core]/cron/fxmanifest.lua index 97d75c99..4d8a3165 100644 --- a/[core]/cron/fxmanifest.lua +++ b/[core]/cron/fxmanifest.lua @@ -4,6 +4,6 @@ game 'gta5' author 'ESX-Framework' description 'cron' lua54 'yes' -version '1.9.5' +version '1.10.1' server_script 'server/main.lua' diff --git a/[core]/es_extended/client/functions.lua b/[core]/es_extended/client/functions.lua index 7ba5dcc3..af1c9183 100644 --- a/[core]/es_extended/client/functions.lua +++ b/[core]/es_extended/client/functions.lua @@ -689,7 +689,7 @@ function ESX.Game.GetVehicleProperties(vehicle) neonColor = table.pack(GetVehicleNeonLightsColour(vehicle)), extras = extras, - dirftTyresEnabled = driftTyresEnabled, + driftTyresEnabled = driftTyresEnabled, tyreSmokeColor = table.pack(GetVehicleTyreSmokeColor(vehicle)), modSpoilers = GetVehicleMod(vehicle, 0), @@ -913,16 +913,10 @@ function ESX.Game.SetVehicleProperties(vehicle, props) ToggleVehicleMod(vehicle, 22, props.modXenon) end if props.modFrontWheels ~= nil then - SetVehicleMod(vehicle, 23, props.modFrontWheels, false) - end - if props.modCustomFrontWheels ~= nil then - SetVehicleMod(vehicle, 23, props.modCustomFrontWheels, false) + SetVehicleMod(vehicle, 23, props.modFrontWheels, props.modCustomFrontWheels) end if props.modBackWheels ~= nil then - SetVehicleMod(vehicle, 24, props.modBackWheels, false) - end - if props.modCustomBackWheels ~= nil then - SetVehicleMod(vehicle, 24, props.modCustomBackWheels, false) + SetVehicleMod(vehicle, 24, props.modBackWheels, props.modCustomBackWheels) end if props.modPlateHolder ~= nil then SetVehicleMod(vehicle, 25, props.modPlateHolder, false) diff --git a/[core]/es_extended/client/main.lua b/[core]/es_extended/client/main.lua index a7ae816a..aaa9053f 100644 --- a/[core]/es_extended/client/main.lua +++ b/[core]/es_extended/client/main.lua @@ -332,9 +332,7 @@ if not Config.OxInventory then RegisterNetEvent('esx:removeWeapon') AddEventHandler('esx:removeWeapon', function(weapon) - local playerPed = ESX.PlayerData.ped - RemoveWeaponFromPed(playerPed, joaat(weapon)) - SetPedAmmo(ESX.PlayerData.ped, joaat(weapon), 0) + print("[^1ERROR^7] event ^5'esx:removeWeapon'^7 Has Been Removed. Please use ^5xPlayer.removeWeapon^7 Instead!") end) RegisterNetEvent('esx:removeWeaponComponent') diff --git a/[core]/es_extended/fxmanifest.lua b/[core]/es_extended/fxmanifest.lua index 193f9518..6dd7df0e 100644 --- a/[core]/es_extended/fxmanifest.lua +++ b/[core]/es_extended/fxmanifest.lua @@ -1,11 +1,9 @@ fx_version 'adamant' game 'gta5' - description 'ES Extended' - lua54 'yes' -version '1.9.5' +version '1.10.1' shared_scripts { 'locale.lua', diff --git a/[core]/es_extended/server/classes/player.lua b/[core]/es_extended/server/classes/player.lua index 52b72225..62c12cf1 100644 --- a/[core]/es_extended/server/classes/player.lua +++ b/[core]/es_extended/server/classes/player.lua @@ -460,7 +460,11 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, end function self.removeWeapon(weaponName) - local weaponLabel + local weaponLabel, playerPed = nil, GetPlayerPed(self.source) + + if not playerPed then + return print("[^1ERROR^7] xPlayer.removeWeapon ^5invalid^7 player ped!") + end for k, v in ipairs(self.loadout) do if v.name == weaponName then @@ -469,6 +473,11 @@ 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) + SetPedAmmo(playerPed, weaponHash, 0) table.remove(self.loadout, k) break @@ -476,7 +485,6 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, end if weaponLabel then - self.triggerEvent('esx:removeWeapon', weaponName) self.triggerEvent('esx:removeInventoryItem', weaponLabel, false, true) end end diff --git a/[core]/esx_context/fxmanifest.lua b/[core]/esx_context/fxmanifest.lua index 2841b9b3..7e52d224 100644 --- a/[core]/esx_context/fxmanifest.lua +++ b/[core]/esx_context/fxmanifest.lua @@ -4,7 +4,7 @@ game 'gta5' author 'ESX-Framework & Brayden' description 'Offical ESX Legacy Context Menu' lua54 'yes' -version '1.9.5' +version '1.10.1' ui_page 'index.html' diff --git a/[core]/esx_identity/fxmanifest.lua b/[core]/esx_identity/fxmanifest.lua index 2a916e95..8afa1611 100644 --- a/[core]/esx_identity/fxmanifest.lua +++ b/[core]/esx_identity/fxmanifest.lua @@ -1,10 +1,9 @@ fx_version 'adamant' game 'gta5' - description 'ESX Identity' lua54 'yes' -version '1.9.5' +version '1.10.1' shared_scripts { '@es_extended/imports.lua', diff --git a/[core]/esx_loadingscreen/fxmanifest.lua b/[core]/esx_loadingscreen/fxmanifest.lua index d0d9a914..68cf84e4 100644 --- a/[core]/esx_loadingscreen/fxmanifest.lua +++ b/[core]/esx_loadingscreen/fxmanifest.lua @@ -1,5 +1,6 @@ game 'common' -version '1.9.5' + +version '1.10.1' fx_version 'cerulean' author 'ESX-Framework' lua54 'yes' diff --git a/[core]/esx_menu_default/fxmanifest.lua b/[core]/esx_menu_default/fxmanifest.lua index 7b82980b..58ad1d73 100644 --- a/[core]/esx_menu_default/fxmanifest.lua +++ b/[core]/esx_menu_default/fxmanifest.lua @@ -1,10 +1,9 @@ fx_version 'adamant' game 'gta5' - description 'ESX Menu Default' lua54 'yes' -version '1.9.5' +version '1.10.1' client_scripts { '@es_extended/imports.lua', 'client/main.lua' } diff --git a/[core]/esx_menu_dialog/fxmanifest.lua b/[core]/esx_menu_dialog/fxmanifest.lua index 62188ede..21ad639e 100644 --- a/[core]/esx_menu_dialog/fxmanifest.lua +++ b/[core]/esx_menu_dialog/fxmanifest.lua @@ -1,10 +1,9 @@ fx_version 'adamant' game 'gta5' - description 'ESX Menu Dialog' lua54 'yes' -version '1.9.5' +version '1.10.1' client_scripts { '@es_extended/imports.lua', diff --git a/[core]/esx_menu_list/fxmanifest.lua b/[core]/esx_menu_list/fxmanifest.lua index 09340c9b..db4b4427 100644 --- a/[core]/esx_menu_list/fxmanifest.lua +++ b/[core]/esx_menu_list/fxmanifest.lua @@ -1,10 +1,10 @@ fx_version 'adamant' game 'gta5' - description 'ESX Menu List' lua54 'yes' -version '1.9.5' +version '1.10.1' + client_scripts { '@es_extended/imports.lua', diff --git a/[core]/esx_multicharacter/fxmanifest.lua b/[core]/esx_multicharacter/fxmanifest.lua index 62cf6896..e3c36f28 100644 --- a/[core]/esx_multicharacter/fxmanifest.lua +++ b/[core]/esx_multicharacter/fxmanifest.lua @@ -1,8 +1,9 @@ fx_version 'cerulean' + game 'gta5' author 'ESX-Framework - Linden - KASH' description 'Official Multicharacter System For ESX Legacy' -version '1.9.5' +version '1.10.1' lua54 'yes' dependencies { 'es_extended', 'esx_context', 'esx_identity', 'esx_skin' } diff --git a/[core]/esx_notify/fxmanifest.lua b/[core]/esx_notify/fxmanifest.lua index a8719b76..04d2cca3 100644 --- a/[core]/esx_notify/fxmanifest.lua +++ b/[core]/esx_notify/fxmanifest.lua @@ -1,7 +1,8 @@ fx_version 'adamant' + lua54 'yes' game 'gta5' -version '1.9.5' +version '1.10.1' author 'ESX-Framework' description 'Official NUI Notification system for ESX' diff --git a/[core]/esx_progressbar/fxmanifest.lua b/[core]/esx_progressbar/fxmanifest.lua index 5982fb01..720378cd 100644 --- a/[core]/esx_progressbar/fxmanifest.lua +++ b/[core]/esx_progressbar/fxmanifest.lua @@ -1,8 +1,9 @@ fx_version 'adamant' + game 'gta5' author 'ESX-Framework' lua54 'yes' -version '1.9.5' +version '1.10.1' description 'ESX Progressbar' client_scripts { 'Progress.lua' } diff --git a/[core]/esx_skin/fxmanifest.lua b/[core]/esx_skin/fxmanifest.lua index 2af52b09..f2c11c1d 100644 --- a/[core]/esx_skin/fxmanifest.lua +++ b/[core]/esx_skin/fxmanifest.lua @@ -1,11 +1,10 @@ fx_version 'adamant' game 'gta5' - description 'ESX Skin' - -version '1.9.5' +version '1.10.1' lua54 'yes' + shared_script '@es_extended/imports.lua' server_scripts { diff --git a/[core]/esx_textui/fxmanifest.lua b/[core]/esx_textui/fxmanifest.lua index 3c276e99..8739c695 100644 --- a/[core]/esx_textui/fxmanifest.lua +++ b/[core]/esx_textui/fxmanifest.lua @@ -1,9 +1,11 @@ fx_version 'adamant' + game 'gta5' author 'ESX-Framework' -version '1.9.5' +version '1.10.1' description 'ESX TextUI' lua54 'yes' + client_scripts { 'TextUI.lua' } shared_script '@es_extended/imports.lua' ui_page 'nui/index.html' diff --git a/[core]/skinchanger/fxmanifest.lua b/[core]/skinchanger/fxmanifest.lua index b10e3fb3..6d91f3d6 100644 --- a/[core]/skinchanger/fxmanifest.lua +++ b/[core]/skinchanger/fxmanifest.lua @@ -1,12 +1,9 @@ fx_version 'adamant' game 'gta5' - lua54 'yes' - description 'Official ESX-Legacy resource for handling the Player`s Skin' - -version '1.9.5' +version '1.10.1' client_scripts { '@es_extended/locale.lua',