Jump to content
Sign in to follow this  
infection

Respawn button delay

Recommended Posts

I've looked around and I can't seem to find it, how can I add a respawn button delay so when you press escape you have to wait 30 seconds? and if possible with abort aswell.

Share this post


Link to post
Share on other sites

This should do the trick

disableSerialization;

while {true} do
{
waitUntil {!(isNull (findDisplay 49))};
((findDisplay 49) displayCtrl 1010) ctrlEnable false;
_time = time;
waitUntil {(isNull (findDisplay 49)) || time >= _time + 30};
if (!(isNull (findDisplay 49))) then
{
	((findDisplay 49) displayCtrl 1010) ctrlEnable true;
	waitUntil {isNull (findDisplay 49)};
};
};

Share this post


Link to post
Share on other sites
This should do the trick

disableSerialization;

while {true} do
{
waitUntil {!(isNull (findDisplay 49))};
((findDisplay 49) displayCtrl 1010) ctrlEnable false;
_time = time;
waitUntil {(isNull (findDisplay 49)) || time >= _time + 30};
if (!(isNull (findDisplay 49))) then
{
	((findDisplay 49) displayCtrl 1010) ctrlEnable true;
	waitUntil {isNull (findDisplay 49)};
};
};

How do you actually set up respawns? I've spent the last 6 hours making a map for a friends unit, but i'm not sure how to get stuff whether soldiers, or vehicles to respawn.

-Skullz

Share this post


Link to post
Share on other sites

Skullz for a basic respawn for infantry follow my tutorial:

How to setup a respawn for MP using a base respawn

http://forums.bistudio.com/showthread.php?116518-Respawn-for-Editor-Missions-played-in-multiplayer&p=1881921#post1881921

for vehicles I highly recommend :

Simple Vehicle Respawn

http://www.armaholic.com/page.php?id=6080&highlight=SIMPLE+VEHICLE+RESPAWN+SCRIPT

just place a vehicle where ever you want it to respawn, and put the code in it, then when the vehicle is

destroyed somewhere the vehicle will respawn where it was originally placed.

Share this post


Link to post
Share on other sites
This should do the trick

disableSerialization;

while {true} do
{
waitUntil {!(isNull (findDisplay 49))};
((findDisplay 49) displayCtrl 1010) ctrlEnable false;
_time = time;
waitUntil {(isNull (findDisplay 49)) || time >= _time + 30};
if (!(isNull (findDisplay 49))) then
{
	((findDisplay 49) displayCtrl 1010) ctrlEnable true;
	waitUntil {isNull (findDisplay 49)};
};
};

I add this to init.sqf? //update, Nevermind got it to work! Thanks a lot! Would it be easy to make it for abort aswell?

Edited by Infection

Share this post


Link to post
Share on other sites

Just gotta find the abort idc, then you can implement it alongside.

Share this post


Link to post
Share on other sites
Just gotta find the abort idc, then you can implement it alongside.

How would I go about doing that? I've got no idea about any of this :p

Share this post


Link to post
Share on other sites

Infection, use the [] call BIS_fnc_ConfigViewer function. Great tool & you'll be able to find 99% of everything that's in the game(s). The other 1% are the things you can't find, that may be deep into the config viewer or in a weird place that you'd never think to look.

Share this post


Link to post
Share on other sites

uhm, Slightly confused by the massive window that popped up :p any tips on how to find the abort IDC?

Share this post


Link to post
Share on other sites

Yeah you have to look through all of the rsc stuff. Once you learn how to navigate it's not so bad.

Share this post


Link to post
Share on other sites
On 1/31/2013 at 10:09 AM, Horner said:

This should do the trick

 


disableSerialization;

while {true} do
{
waitUntil {!(isNull (findDisplay 49))};
((findDisplay 49) displayCtrl 1010) ctrlEnable false;
_time = time;
waitUntil {(isNull (findDisplay 49)) || time >= _time + 30};
if (!(isNull (findDisplay 49))) then
{
	((findDisplay 49) displayCtrl 1010) ctrlEnable true;
	waitUntil {isNull (findDisplay 49)};
};
};
 



update 2023 - this code no longer works. Getting "error suspending not allowed in this context"

anyone know how to fix?

Edited by bendy303
not clear

Share this post


Link to post
Share on other sites

I used chatgpt to come up with code, this if for use with CBA mod, and its not working either.

 

// Define a function to handle the pause event
_handlePause = {
    params ["_unit", "_pauseState"];
    
    if (_pauseState) then {
        diag_log "Game is paused!";
    }
};

// Add an event handler for the pause event
["onPause", { true }] call CBA_fnc_addEventHandler;
["onPause", _handlePause] call CBA_fnc_addEventHandler;

 

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
Sign in to follow this  

×