Jump to content
SageNTitled

[SOLVED] Respawn delay as parameter

Recommended Posts

Does someone know how to set the respawn delay from a parameter value? I've found the following code from the End Game scenario that BIS is using, but simply putting it into my scenario isn't working.

 

description.ext

class Params
{
	class RespawnDelay
	{
		title = $STR_A3_EndGame_RespawnDelay;
		values[] = {15, 30, 45, 60};
		texts[] = {$STR_A3_EndGame_RespawnDelay_15, $STR_A3_EndGame_RespawnDelay_30, $STR_A3_EndGame_RespawnDelay_45, $STR_A3_EndGame_RespawnDelay_60};
		default = 30;
		file = "params\setRespawnDelay.sqf";
	};
};

params\setRespawnDelay.sqf

if (isServer) then
{
	private ["_delay"];
	_delay = [_this, 0, 1200, [0]] call bis_fnc_param;

	BIS_initialRespawnDelay = _delay;
};

What is BIS_initialRespawnDelay and where does it go? I can't find it anywhere. If anyone can shed some light on this problem it will be highly appreciated.

Share this post


Link to post
Share on other sites

Might want to give this one a shot? BIS_fnc_setRespawnDelay(https://community.bistudio.com/wiki/BIS_fnc_setRespawnDelay). I'm trying to do this myself but still failed to make it work. 

(Description.ext)

  class respawncounter
    {// 22
        title = "Respawn Delay";
        values[] = {5, 30, 60};
        texts[] = {"5","30", "Default(60)"};
        default = 60;
    }


(init.sqf or initPlayerLocal or initServer)I still don't know where to put this also.

 

//respawnDelay

_respawnCounter = "respawncounter" call BIS_fnc_getParamValue;

[{_respawnCounter < 60}, _respawnCounter, "New Respawn Delay Set!"] call BIS_fnc_setRespawnDelay;

 

 

Share this post


Link to post
Share on other sites

If this is multiplayer you use the attributes drop down in the editor, select multiplayer and down there is a respawn delay setting. Single player? I haven't seen a way to respawn in that, its either coop or multiplayer with your own computer acting as server.

Share this post


Link to post
Share on other sites
On 18/05/2016 at 4:43 PM, Fiddi said:

This might be in the ballpark.

https://community.bistudio.com/wiki/setPlayerRespawnTime

 

Never used it myself.

// description.ext
class Params
{
	class respawnDelay
	{
		title = "Respawn delay?";
		texts[] = {"1", "5", "10", "15", "60"};
		values[] = {1, 5, 10, 15, 60};
		default = 5;
	};
};

// init.sqf
_respawnDelay = "respawnDelay" call BIS_fnc_getParamValue;
setPlayerRespawnTime _respawnDelay;

Why use the BIS function? There is a command for it.

  • 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

×