setPlayerRespawnTime: Difference between revisions
Lou Montana (talk | contribs) m (Text replacement - "<code>\[\[([a-zA-Z0-9_]+)\]\] ([a-zA-Z0-9_]+);?<\/code>" to "<sqf>$1 $2;</sqf>") |
Lou Montana (talk | contribs) (Add "next respawn only" information) |
||
| Line 14: | Line 14: | ||
|gr1= Multiplayer | |gr1= Multiplayer | ||
|descr= Sets the time interval (in seconds) that the player must wait before respawn. 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. | |descr= 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. | |||
|s1= [[setPlayerRespawnTime]] interval | |s1= [[setPlayerRespawnTime]] interval | ||
| Line 22: | Line 24: | ||
|r1= [[Nothing]] | |r1= [[Nothing]] | ||
|x1= <sqf>setPlayerRespawnTime 5;</sqf> | |x1= <sqf>setPlayerRespawnTime 5; // next respawn (and only this one) will happen 5s after death</sqf> | ||
|x2= Set the respawn duration through variable: | |||
<sqf> | |||
player addEventHandler ["Killed", { | |||
setPlayerRespawnTime (player getVariable ["TAG_RespawnDelay", 10]); | |||
}]; | |||
</sqf> | |||
Somewhere else, e.g on objective completion: | |||
<sqf> | |||
waitUntil { not alive _target }; | |||
_thatPlayer setVariable ["TAG_RespawnDelay", 5]; | |||
</sqf> | |||
|seealso= [[playerRespawnTime]] [[respawnVehicle]] | |seealso= [[playerRespawnTime]] [[respawnVehicle]] | ||
}} | }} | ||
Revision as of 11:56, 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]); }];
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