Scripting/Server/Functions/SetDefaultWastedSettings
(v0.5-rc2+) How every player's own death plays out. Never called = the game's default flow (the camera turns up into the sky, the screen fades to grey-white, the game respawns the player after about 4 s). After SetDefaultWastedSettings the client holds the dead player: the death camera does not turn when rotateCamera is false (the view stays on the body), there is no automatic grey-white fade, and the player respawns only after msTimeToRespawn milliseconds - 0 means never: the gamemode decides, in onPlayerDeath / onPlayerKill, with player.Spawn() or player.RespawnAt(pos). With msTimeToRespawn above 0 the screen fades out to the colour r, g, b (0-255) during the last 2 s before the respawn and fades back in after it. The settings are server wide, are sent to players who join later, and last until ResetWastedSettings() (back to the default flow) or the end of the server run. Example: SetDefaultWastedSettings(0, false, 0, 0, 0); then function onPlayerDeath(p, reason) { NewTimer("respawn", 3000, 1, p); }.
Syntax
SetDefaultWastedSettings(msTimeToRespawn, rotateCamera, r, g, b)SetWastedSettings(...)ResetWastedSettings()Arguments
- any msTimeToRespawn – After
SetDefaultWastedSettingsthe client holds the dead player: the death camera does not turn whenrotateCameraisfalse(the view stays on the body), there is no automatic grey-white fade, and the player respawns only aftermsTimeToRespawnmilliseconds -0means never: the gamemode decides, inonPlayerDeath/onPlayerKill, withplayer.Spawn()orplayer.RespawnAt(pos). - any rotateCamera – After
SetDefaultWastedSettingsthe client holds the dead player: the death camera does not turn whenrotateCameraisfalse(the view stays on the body), there is no automatic grey-white fade, and the player respawns only aftermsTimeToRespawnmilliseconds -0means never: the gamemode decides, inonPlayerDeath/onPlayerKill, withplayer.Spawn()orplayer.RespawnAt(pos). - float r
- float g
- float b
Example
function onScriptLoad()
{
// no automatic respawn, the camera stays on the body, black fade; the gamemode respawns the player itself
SetDefaultWastedSettings( 0, false, 0, 0, 0 );
}
function onPlayerDeath( player, reason )
{
NewTimer( "respawnMe", 3000, 1, player );
}
function respawnMe( player )
{
player.Spawn();
}Related pages
- ToggleRealMoney
- SetTime
- SetTimeLock
- SetTimeScale
- SetWeatherLock
- GetTime
- SetWeather
- SetVirtualWorldTime
- SetVirtualWorldWeather
- SetGamespeed
- SetGravity
- ToggleImprovedCarCam
Section: World settings