Set Spawn for existing player

Hello everyone !
I currently create my own Framework But i have an issue for spawning at right position existing player!

So have a stored position for they ! And when a player conect he alwas spawn at my default spawn point store in Map stock ressource !

My client when start send message to server for take all the player data need and store in client global variable. After this server trigger this client event:

RegisterNetEvent("oc_core:SetPlayerSpawn")
AddEventHandler("oc_core:SetPlayerSpawn", function(spawn)
    local src = source
    print("SetSpawnPoint")
    setPlayerSpawn(src, spawn)
end)

spawn look like this :

 local spawn = {
                x = player.position.coordinates.x,
                y = player.position.coordinates.y,
                z = player.position.coordinates.z,
                heading = player.position.heading,
                skipFade = false
            }

Thanks for reading .

1 Like

Ok i find the solution ! U just need to remove [map] folder in [Gamemodes] and let go u can use ur on spawn point like upward!

1 Like