Custom spawn manager

Hello there.
I want to make my own resource and I don’t want to use any of the included ones (gamemodes, gameplay, …)
I now don’t know how to make my own spawn manager - how do I make a custom spawn point for all players? I don’t know how to use “spawnPlayer” function, can i get some examples?
Oh and I am making my scripts in Visual studio C#.

Thank you

function spawnPlayer(spawnIdx, cb)

Don’t know if this helps

Where would I put spawnPlayer function, inside OnPlayerConnecting event?
But it doesn’t seem to find that functuin in visual studio.

You don’t make your own spawnmanager, you utilize the spawnmanager functions see https://docs.fivem.net/docs/resources/spawnmanager/

Ok, but how can i call the function spawnPlayer from my C# script and how do I set the default spawn location for all players?

                float x = -812.0f;
                float y = -125.0f;
                float z = 9.0f;
                float heading = 45.0f;

                Exports["spawnmanager"].spawnPlayer(new
                {
                    x, y, z,
                    model = (int)PedHash.CiaSec01SMM,
                    heading
                });

for example