Hi guys, the problem is that every time you log in, it sets the player's position, interior ID, dimension, etc. from a MySql table, but no matter how well you set it and write out the correct data, for some reason I can't see anything, only my character floating in the sky, although I think it's here in the Interior, it's just not visible for some reason. I also tried to handle the problem on the client side.
---SERVER SIDE
local int = result[1]["interior"]
local dim = result[1]["dim"]
local pos = fromJSON(result[1]["pos"])
setTimer(function()
spawnPlayer(player, pos[1], pos[2], pos[3]+1, 90, skin, tonumber(int), tonumber(dim))
setElementInterior(player, tonumber(int))
setElementDimension(player, tonumber(dim))
triggerClientEvent(player, "fixClientSpawn", root, tonumber(int), tonumber(dim))
end, 200, 1)
--CLIENT SIDE
addEvent("fixClientSpawn", true)
addEventHandler("fixClientSpawn", root, function(int, dim)
setElementInterior(localPlayer, int)
setElementDimension(localPlayer, dim)
setCameraTarget(localPlayer)
outputDebugString("CLIENT FIX: INT "..int.." DIM "..dim)
end)