Added Database
This commit is contained in:
1 parent
477f3d51f0
commit
5c0267981d
9 files changed
+107
-51
No files matched your search
@@ -1,48 +0,0 @@
|
||||
name: Build ZIP
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
|
||||
jobs:
|
||||
zip:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set zip name
|
||||
run: |
|
||||
REPO="${GITHUB_REPOSITORY##*/}"
|
||||
echo "ZIP_NAME=${REPO}.zip" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Create flat zip (no root folder)
|
||||
run: |
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
zip -r "${ZIP_NAME}" ./* \
|
||||
-x "web/react/*" "web/react/**" \
|
||||
-x ".git/*" ".git/**" \
|
||||
-x "**/node_modules/**" \
|
||||
-x ".gitignore" \
|
||||
-x ".github/**" \
|
||||
-x "**/*.zip"
|
||||
|
||||
- name: Upload to GitHub Release (always overwrite 'latest')
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: latest
|
||||
name: Latest Build
|
||||
body: |
|
||||
This is an automatically built ZIP from the latest push to `main`.
|
||||
draft: false
|
||||
prerelease: false
|
||||
files: |
|
||||
${{ env.ZIP_NAME }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -46,3 +46,4 @@ coverage/
|
||||
# Temporary folders
|
||||
tmp/
|
||||
temp/
|
||||
playerScaling.json
|
||||
+18
-3
@@ -1,5 +1,21 @@
|
||||
--https://github.com/alp1x/um-ped-scale
|
||||
--Main scaling function based off of this script
|
||||
--[[
|
||||
https://github.com/alp1x/um-ped-scale
|
||||
Main scaling function based off of this script
|
||||
|
||||
███╗ ██╗ █████╗ ███████╗███████╗ ██████╗ ███████╗██████╗ ███████╗ ██████╗ █████╗ ██╗ ███████╗██████╗
|
||||
████╗ ██║██╔══██╗██╔════╝██╔════╝ ██╔══██╗██╔════╝██╔══██╗██╔════╝██╔════╝██╔══██╗██║ ██╔════╝██╔══██╗
|
||||
██╔██╗ ██║███████║███████╗███████╗ ██████╔╝█████╗ ██║ ██║███████╗██║ ███████║██║ █████╗ ██████╔╝
|
||||
██║╚██╗██║██╔══██║╚════██║╚════██║ ██╔═══╝ ██╔══╝ ██║ ██║╚════██║██║ ██╔══██║██║ ██╔══╝ ██╔══██╗
|
||||
██║ ╚████║██║ ██║███████║███████║███████╗██║ ███████╗██████╔╝███████║╚██████╗██║ ██║███████╗███████╗██║ ██║
|
||||
╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝╚═╝ ╚══════╝╚═════╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝
|
||||
|
||||
https://discord.gg/nass
|
||||
|
||||
Please support the development of this script by joining our discord server.
|
||||
]]
|
||||
|
||||
|
||||
|
||||
local function norm(vec)
|
||||
local mag = math.sqrt(vec.x ^ 2 + vec.y ^ 2 + vec.z ^ 2)
|
||||
if mag > 0 then
|
||||
@@ -113,7 +129,6 @@ RegisterNUICallback('get_config', function(data, cb)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('nass_pedscaler:openMenu', function()
|
||||
print("Opening ped scaler menu...")
|
||||
SetNuiFocus(true, true)
|
||||
SendNUIMessage({
|
||||
action = "visible",
|
||||
|
||||
+13
@@ -1,3 +1,16 @@
|
||||
--[[
|
||||
███╗ ██╗ █████╗ ███████╗███████╗ ██████╗ ███████╗██████╗ ███████╗ ██████╗ █████╗ ██╗ ███████╗██████╗
|
||||
████╗ ██║██╔══██╗██╔════╝██╔════╝ ██╔══██╗██╔════╝██╔══██╗██╔════╝██╔════╝██╔══██╗██║ ██╔════╝██╔══██╗
|
||||
██╔██╗ ██║███████║███████╗███████╗ ██████╔╝█████╗ ██║ ██║███████╗██║ ███████║██║ █████╗ ██████╔╝
|
||||
██║╚██╗██║██╔══██║╚════██║╚════██║ ██╔═══╝ ██╔══╝ ██║ ██║╚════██║██║ ██╔══██║██║ ██╔══╝ ██╔══██╗
|
||||
██║ ╚████║██║ ██║███████║███████║███████╗██║ ███████╗██████╔╝███████║╚██████╗██║ ██║███████╗███████╗██║ ██║
|
||||
╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝╚═╝ ╚══════╝╚═════╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝
|
||||
|
||||
https://discord.gg/nass
|
||||
|
||||
Please support the development of this script by joining our discord server.
|
||||
]]
|
||||
|
||||
Config = {}
|
||||
Config.locale = Locales["en"]
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
playerScaling = json.decode(LoadResourceFile(GetCurrentResourceName(), "./playerScaling.json")) or {}
|
||||
|
||||
function onPlayerLoaded(identifier, source)
|
||||
local playerscale = playerScaling[identifier]
|
||||
if playerscale and playerscale ~= 1.0 then
|
||||
TriggerClientEvent('nass_pedscaler:syncScale', -1, source, playerscale)
|
||||
end
|
||||
end
|
||||
|
||||
AddEventHandler('onResourceStart', function(resourceName)
|
||||
if (GetCurrentResourceName() ~= resourceName) then return end
|
||||
Wait(1000)
|
||||
for _, player in pairs(GetPlayers()) do
|
||||
onPlayerLoaded(getPlayerIdentifier(player), player)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
AddEventHandler('onResourceStop', function(resourceName)
|
||||
if (GetCurrentResourceName() ~= resourceName) then return end
|
||||
|
||||
SaveResourceFile(GetCurrentResourceName(), "playerScaling.json", json.encode(playerScaling), -1)
|
||||
end)
|
||||
@@ -0,0 +1,11 @@
|
||||
if GetResourceState('es_extended') ~= 'started' then return end
|
||||
ESX = exports["es_extended"]:getSharedObject()
|
||||
|
||||
function getPlayerIdentifier(source)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
return xPlayer.identifier
|
||||
end
|
||||
|
||||
AddEventHandler('esx:playerLoaded', function(playerId, xPlayer, isNew)
|
||||
onPlayerLoaded(xPlayer.identifier, playerId)
|
||||
end)
|
||||
@@ -0,0 +1,11 @@
|
||||
if GetResourceState('qb-core') ~= 'started' then return end
|
||||
QBCore = exports["qb-core"]:GetCoreObject()
|
||||
|
||||
function getPlayerIdentifier(source)
|
||||
local xPlayer = QBCore.Functions.GetPlayer(source)
|
||||
return xPlayer.PlayerData.citizenid
|
||||
end
|
||||
|
||||
AddEventHandler('QBCore:Server:PlayerLoaded', function(Player)
|
||||
onPlayerLoaded(Player.PlayerData.citizenid, Player.PlayerData.source)
|
||||
end)
|
||||
@@ -0,0 +1,11 @@
|
||||
if GetResourceState('qb-core') == 'started' then return end
|
||||
if GetResourceState('es_extended') == 'started' then return end
|
||||
|
||||
function getPlayerIdentifier(source)
|
||||
return GetPlayerIdentifierByType(source, 'license')
|
||||
end
|
||||
|
||||
AddEventHandler('playerJoining', function(playerId)
|
||||
local identifier = getPlayerIdentifier(playerId)
|
||||
onPlayerLoaded(identifier, playerId)
|
||||
end)
|
||||
@@ -1,5 +1,23 @@
|
||||
--[[
|
||||
https://github.com/alp1x/um-ped-scale
|
||||
Main scaling function based off of this script
|
||||
|
||||
███╗ ██╗ █████╗ ███████╗███████╗ ██████╗ ███████╗██████╗ ███████╗ ██████╗ █████╗ ██╗ ███████╗██████╗
|
||||
████╗ ██║██╔══██╗██╔════╝██╔════╝ ██╔══██╗██╔════╝██╔══██╗██╔════╝██╔════╝██╔══██╗██║ ██╔════╝██╔══██╗
|
||||
██╔██╗ ██║███████║███████╗███████╗ ██████╔╝█████╗ ██║ ██║███████╗██║ ███████║██║ █████╗ ██████╔╝
|
||||
██║╚██╗██║██╔══██║╚════██║╚════██║ ██╔═══╝ ██╔══╝ ██║ ██║╚════██║██║ ██╔══██║██║ ██╔══╝ ██╔══██╗
|
||||
██║ ╚████║██║ ██║███████║███████║███████╗██║ ███████╗██████╔╝███████║╚██████╗██║ ██║███████╗███████╗██║ ██║
|
||||
╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝╚═╝ ╚══════╝╚═════╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝
|
||||
|
||||
https://discord.gg/nass
|
||||
|
||||
Please support the development of this script by joining our discord server.
|
||||
]]
|
||||
|
||||
RegisterNetEvent('nass_pedscaler:syncScale', function(scale)
|
||||
local src = source
|
||||
playerScaling[getPlayerIdentifier(src)] = scale
|
||||
|
||||
TriggerClientEvent('nass_pedscaler:syncScale', -1, src, scale)
|
||||
end)
|
||||
|
||||
@@ -16,6 +34,7 @@ if Config.commands.resetScale.enabled then
|
||||
RegisterCommand(Config.commands.resetScale.command, function(source, args)
|
||||
local id = tonumber(args[1]) or source
|
||||
if hasPermission(source, id == source and "resetSelf" or "resetOther") then
|
||||
playerScaling[getPlayerIdentifier(id)] = nil
|
||||
TriggerClientEvent('nass_pedscaler:syncScale', -1, id, nil)
|
||||
end
|
||||
end, false)
|
||||
|
||||
Reference in new issue
Block a user