OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: UH60MG on 06 Mar 2008, 20:12:43
-
Is it possible to allow respawning once the players character is dead as in multiplayer?
-
You might do something similar with killed event handler. Add this to the init field of the player:
this addEventHandler ["killed", {(_this select 0) setDamage 0; (_this select 0) setPos getMarkerPos "mk_respawn"]}]
-
Mandoble's code won't work -> in ArmA, it's entirely impossible to revive a dead entity in SP, AI or Player.
However, you CAN "Respawn" a player simply by using selectPlayer/adding a new unit to the switchableUnits array (and allow the player to pick their teamswitch in the death-menu).
something like:
this addeventhandler ["killed", {addSwitchableUnit RespawnDude; selectPlayer RespawnDude}]
You could of course just keep creating new units named "RespawnDude" as well to make sure the "killed" eventhandler always has someone to respawn into. Or use some script. :) All is possible!
Good luck!
Wolfrug out.