Jump to content
Sp0oX

how to stop the forced respawn when players join server

Recommended Posts

Hey guys I have a dedicated server I play on with my friends and I want to make it so their "character" is persistent. so I enabled AI which makes it so that when they log off the AI takes control of the character till someone logs back into that slot. which is great until someone dies, then it tells them that respawn is disabled and cant respawn. so I added a respawn module. however now whenever someone logs into their specific character the games kills the character and forces a respawn. making them lose their loadout and log off position. is there any way to make it so that when they join they simply take over the AI character but still have a respawn point if they die?

Share this post


Link to post
Share on other sites

If the problem is losing loadout and position, you can write a script that will save their loadout and position (getUnitLoadout, getPos) when they quit and set the loadout (setUnitLoadout, setPos) and position when they rejoin.

Share this post


Link to post
Share on other sites
6 minutes ago, _foley said:

If the problem is losing loadout and position, you can write a script that will save their loadout and position (getUnitLoadout, getPos) when they quit and set the loadout (setUnitLoadout, setPos) and position when they rejoin.

 

 I was hoping this could be done without scripting but I suppose I've avoided learning to script arma long enough. Thank you for giving me the basic commands I will give it a try.  Also thx for the quick response!

Share this post


Link to post
Share on other sites

I use this on Description.ext to eliminate the forced respawn at join: 

respawnOnStart = -1;

  • Like 1

Share this post


Link to post
Share on other sites

The following will save your loadout and give it back to you after you respawn, you'll have

exactly everything you had before you died.

========================

Create this script, can be done with notepad

name the script ---->  onPlayerKilled.sqf

 

inside the script put this:

player setVariable["Saved_Loadout",getUnitLoadout player];

save and put the script in your mission folder.

 

Create this script, again create it with notepad

name the script ----->  onPlayerRespawn.sqf

 

inside this script put this:

removeAllWeapons player;
removeGoggles player;
removeHeadgear player;
removeVest player;
removeUniform player;
removeAllAssignedItems player;
clearAllItemsFromBackpack player;
removeBackpack player;
player setUnitLoadout(player getVariable["Saved_Loadout",[]]);

In your mission's Description.ext put

respawnOnStart = -1;

=================

Hope that helps! Cheers!

 

  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×