mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
fix(esx_skin): fix /saveskin command and add missing params
This commit is contained in:
@@ -134,13 +134,14 @@ function CreateSkinCam()
|
||||
end
|
||||
|
||||
local playerPed = PlayerPedId()
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
|
||||
SetCamActive(cam, true)
|
||||
RenderScriptCams(true, true, 500, true, true)
|
||||
|
||||
isCameraActive = true
|
||||
SetCamCoord(cam, GetEntityCoords(playerPed))
|
||||
SetCamRot(cam, 0.0, 0.0, 270.0, true)
|
||||
SetCamCoord(cam, coords.x, coords.y, coords.z)
|
||||
SetCamRot(cam, 0.0, 0.0, 270.0, 2)
|
||||
SetEntityHeading(playerPed, 0.0)
|
||||
end
|
||||
|
||||
|
||||
@@ -40,8 +40,12 @@ AddEventHandler("esx_skin:responseSaveSkin", function(skin)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
if xPlayer.getGroup() == "admin" then
|
||||
local file = io.open("resources/[esx]/esx_skin/skins.txt", "a")
|
||||
|
||||
print("[^3WARNING^7] /saveskin is a debug command and should not be used in production")
|
||||
local path = GetResourcePath(GetCurrentResourceName())
|
||||
local file = io.open(("%s/skins.txt"):format(path), "a")
|
||||
if not file then
|
||||
return
|
||||
end
|
||||
file:write(json.encode(skin) .. "\n\n")
|
||||
file:flush()
|
||||
file:close()
|
||||
@@ -56,7 +60,7 @@ ESX.RegisterServerCallback("esx_skin:getPlayerSkin", function(source, cb)
|
||||
MySQL.query("SELECT skin FROM users WHERE identifier = @identifier", {
|
||||
["@identifier"] = xPlayer.identifier,
|
||||
}, function(users)
|
||||
local user, skin = users[1]
|
||||
local user, skin = users[1], nil
|
||||
|
||||
local jobSkin = {
|
||||
skin_male = xPlayer.job.skin_male,
|
||||
|
||||
Reference in New Issue
Block a user