Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

Recommended Posts

Hello, I'm trying to put the RespawnDelay value in the Mission Parameters so I can change the duration anytime before I start the game. I'm currently trying to use this function BIS_fnc_setRespawnDelay(https://community.bistudio.com/wiki/BIS_fnc_setRespawnDelay) as it says that it can "set" the respawn delay value. This is what I have.

description.ext

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

init.sqf(not sure if I should put this in initServer or initLocalPlayer) Also the "Hint" in this code is just a tester seeing if I'm really getting the value coming from the params.

_respawnCounter = "respawncounter" call BIS_fnc_getParamValue;
hint format ["Respawn Delay %1", _respawnCounter];
[{_respawnCounter < 60}, 30, ""] call BIS_fnc_setRespawnDelay;

Huge thanks to whoever helps.


Update: Apologies for having multiple threads going up because of me, I didn't know that the other threads will be bumped up the list due to my reply. Anyways after fiddling with my code and tried searching for some related topics to this I found out that adding an event handler would do the trick and by making the Variable into a public instead of a private made it work also I used the setPlayerRespawnTime instead of the BIS_fnc_setRespawnDelay(this seems to be not working for me even though I tried putting my variable into a public).
 

respawnCounter = "respawncounter" call BIS_fnc_getParamValue;
hint format ["Respawn Delay %1", respawnCounter];
if (respawnCounter != 60) then {
	player addEventHandler ["Killed",{setPlayerRespawnTime respawncounter}];
}

But if anyone has a shorter or better version with the same concept, feel free to share it here. 

Edited by kohara_02
I created this topic, cause I didn't know that my replies on other topics will make the topic go up the lists. Though I got it solved! My Apologies though.

Share this post


Link to post
Share on other sites

How many posts do you intend to write for your question? Counted 3 so far!

Share this post


Link to post
Share on other sites
20 minutes ago, pierremgi said:

How many posts do you intend to write for your question? Counted 3 so far!


Sorry, I didn't know that the other threads would go up due to my reply.

Share this post


Link to post
Share on other sites

×