Respawn INIT

From F2 EN
Jump to: navigation, search

Description

When a player respawns you may want to execute selected scripts, such as changing her/his loadout or providing the ability for the player to join a different existing group. The Respawn INIT component uses a killed event handler to listen for the player's death, and then runs a local script containing your custom commands. By default, this component is designed to work with the JIP Reinforcement Options component.

Required files

All the code associated with this component is found in:

  • init.sqf
  • init_onPlayerRespawn.sqf

How to use

Disabling the JIP Reinforcement Options on respawn

If you would like to stop the JIP Reinforcement Options component being enabled at each respawn, open the file init_onPlayerRespawn.sqf and edit the following line, adding the // at the start:

nul = [player] execVM "f\common\f_JIP_addReinforcementOptionsAction.sqf"; 

Adding more commands to be executed on respawn

Open the file init_onPlayerRespawn.sqf and add your new commands after the following line:

nul = [player] execVM "f\common\f_JIP_addReinforcementOptionsAction.sqf"; 

How to disable

Open the file init.sqf and look for the code segment entitled:

// F2 - Respawn INIT

Edit the line below, adding // to the start:

f_respawnINIT = player addEventHandler ["killed", {_this execVM "init_onPlayerRespawn.sqf"}];

Credits

  • Fer