mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
fix(esx_skin): fix /saveskin command and add missing params
This commit is contained in:
@@ -134,13 +134,14 @@ function CreateSkinCam()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local playerPed = PlayerPedId()
|
local playerPed = PlayerPedId()
|
||||||
|
local coords = GetEntityCoords(playerPed)
|
||||||
|
|
||||||
SetCamActive(cam, true)
|
SetCamActive(cam, true)
|
||||||
RenderScriptCams(true, true, 500, true, true)
|
RenderScriptCams(true, true, 500, true, true)
|
||||||
|
|
||||||
isCameraActive = true
|
isCameraActive = true
|
||||||
SetCamCoord(cam, GetEntityCoords(playerPed))
|
SetCamCoord(cam, coords.x, coords.y, coords.z)
|
||||||
SetCamRot(cam, 0.0, 0.0, 270.0, true)
|
SetCamRot(cam, 0.0, 0.0, 270.0, 2)
|
||||||
SetEntityHeading(playerPed, 0.0)
|
SetEntityHeading(playerPed, 0.0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -40,8 +40,12 @@ AddEventHandler("esx_skin:responseSaveSkin", function(skin)
|
|||||||
local xPlayer = ESX.GetPlayerFromId(source)
|
local xPlayer = ESX.GetPlayerFromId(source)
|
||||||
|
|
||||||
if xPlayer.getGroup() == "admin" then
|
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:write(json.encode(skin) .. "\n\n")
|
||||||
file:flush()
|
file:flush()
|
||||||
file:close()
|
file:close()
|
||||||
@@ -56,7 +60,7 @@ ESX.RegisterServerCallback("esx_skin:getPlayerSkin", function(source, cb)
|
|||||||
MySQL.query("SELECT skin FROM users WHERE identifier = @identifier", {
|
MySQL.query("SELECT skin FROM users WHERE identifier = @identifier", {
|
||||||
["@identifier"] = xPlayer.identifier,
|
["@identifier"] = xPlayer.identifier,
|
||||||
}, function(users)
|
}, function(users)
|
||||||
local user, skin = users[1]
|
local user, skin = users[1], nil
|
||||||
|
|
||||||
local jobSkin = {
|
local jobSkin = {
|
||||||
skin_male = xPlayer.job.skin_male,
|
skin_male = xPlayer.job.skin_male,
|
||||||
|
|||||||
Reference in New Issue
Block a user