Disable auto respawning

I have tried multiple things but nothing has worked so far. So I have tried following but it doesn’t seem to work.

AddEventHandler("playerSpawned", function(spawn)
    exports.spawnmanager:setAutoSpawn(false)
end)

Any ideas? I have looked up threads with similar issues and tried available responses but nothing has worked so far.

2 Likes

TLDR: You have disable vehicle spawning every game frame

Uhh, that’s irrelevant to my question. (Not sure if my original question was obvious enough, I thought it was). So basically, when player dies I want player to stay on the ground, aka disable auto respawning when player dies.

D0p3t probs posted on the wrong topic :joy:

Take a look at my release below. That will have the spawnmanagers exports being used.

I have added this client side and killed myself afterwards, still respawned instantly.

AddEventHandler('onClientMapStart', function()
	Citizen.Trace("RPRevive: Disabling le autospawn.")
	exports.spawnmanager:spawnPlayer() -- Ensure player spawns into server.
	Citizen.Wait(2500)
	exports.spawnmanager:setAutoSpawn(false)
	Citizen.Trace("RPRevive: Autospawn is disabled.")
end)

Do I need to add anything else or? What am I missing?

No I didn’t, I saw “auto” and thought of “vehicle”, because that’s the Dutch word for it :slight_smile:

Use spawnmanager like that should work :thinking:

Ogg haha. When you get caught up in languages

Make sure another resource doesn’t enable autospawn :wink:

have you got the way to resolved this issue? i’m having the exact same problem. thanks

1 Like

Same here