DayZ
PvZmoD_TheDarkHorde
 This topic has been pinned, so it's probably important
Liven  [developer] Feb 26, 2021 @ 7:51am
How to teleport a respawning players near the horde
This feature can be interesting to refresh the early game or for community events focused on the dark horde.

To use this feature you first have to activate it in Pvz_TheDarkHorde_EventManager.xml, set “Teleport_Players_On_Respawn” value to “1”.
Then you have to modify the init.c file in your mpmission.

If the “ CreateCharacter” fonction already exists in your init.c
class CustomMission: MissionServer { override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName) { /// Code to teleport the players near the dark horde when they respawn after they died /// if (m_Pvz_DH_DataEvent.teleportOnDarkHordeWhenPlayerRespawn == true) { vector updatedPosition = Get_Pvz_DH_ManageEvent().GetTeleportPosition(true); if (updatedPosition != Vector(0, 0, 0)) pos = updatedPosition; } /// End of the code /// /// Keep here the code that already exist in your init.c CreateCharacter fonction /// } }


If the “ CreateCharacter” fonction doesn’t exists in your init.c
class CustomMission: MissionServer { override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName) { /// Code to teleport the players near the dark horde when they respawn after they died /// if (m_Pvz_DH_DataEvent.teleportOnDarkHordeWhenPlayerRespawn == true) { vector updatedPosition = Get_Pvz_DH_ManageEvent().GetTeleportPosition(true); if (updatedPosition != Vector(0, 0, 0)) pos = updatedPosition; } return super.CreateCharacter(identity, pos, ctx, characterName); } }

Note that if you unload the Dark Horde mod you will have to delete the code added or your server will not start.