setPlayerRespawnTime: Difference between revisions
Lou Montana (talk | contribs) m (Add example 3) |
Lou Montana (talk | contribs) m (Fix example 2) |
||
| Line 34: | Line 34: | ||
Somewhere else, e.g on objective completion: | Somewhere else, e.g on objective completion: | ||
<sqf> | |||
player setVariable ["TAG_RespawnDelay", 5]; | |||
</sqf> | |||
or if that player is on another machine: | |||
<sqf> | <sqf> | ||
waitUntil { not alive _target }; | waitUntil { not alive _target }; | ||
_thatPlayer setVariable ["TAG_RespawnDelay", 5]; | _thatPlayer setVariable ["TAG_RespawnDelay", 5, true]; | ||
</sqf> | </sqf> | ||
Revision as of 13:42, 22 January 2026
Description
- Description:
- Sets the time interval (in seconds) that the player must wait before respawn, for the next respawn only. It resets to mission default on mission start. In Single Player or when respawn type is GROUP or SIDE in Multiplayer, setting player respawn time has no effect, and playerRespawnTime will always return -1.
- Groups:
- Multiplayer
Syntax
- Syntax:
- setPlayerRespawnTime interval
- Parameters:
- interval: Number - respawn time in seconds
- Return Value:
- Nothing
Examples
- Example 1:
- setPlayerRespawnTime 5; // next respawn (and only this one) will happen 5s after death
- Example 2:
- Set the respawn duration through variable:
Somewhere else, e.g on objective completion:player addEventHandler ["Killed", { setPlayerRespawnTime (player getVariable ["TAG_RespawnDelay", 10]); }];or if that player is on another machine:
- Example 3:
- Increase respawn duration every death:
player addEventHandler ["Killed", { private _respawnTime = player getVariable ["TAG_RespawnDelay", 8]; setPlayerRespawnTime _respawnTime; _respawnTime = _respawnTime + 1;// don't die too many times player setVariable ["TAG_RespawnDelay", _respawnTime]; }];
Additional Information
- See also:
- playerRespawnTime respawnVehicle
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note