9 protected ResourceName m_SpawnPointPrefab;
14 [
Attribute(
"0",
desc:
"If true players are able to spawn at stationary command truck vehicles")]
17 [
Attribute(
"1",
desc:
"It allows players to deploy their radiobackpack and create a deployable radio spawn point. It still allows existing deployed radio spawnpoints to be deconstructed by players if this bool is false")]
23 protected ref map<int, SCR_PlayerSpawnPoint>
m_SpawnPoints =
new map<int, SCR_PlayerSpawnPoint>();
41 array<int> playerIDs = {};
42 int playerIDCount =
GetGame().GetPlayerManager().GetPlayers(playerIDs);
43 for (
int i; i < playerIDCount; i++)
58 if (notificationPlayerID > 0)
61 SCR_NotificationsComponent.SendToEveryone(
ENotification.EDITOR_ATTRIBUTES_ENABLE_RESPAWN_ON_PLAYER, notificationPlayerID);
63 SCR_NotificationsComponent.SendToEveryone(
ENotification.EDITOR_ATTRIBUTES_DISABLE_RESPAWN_ON_PLAYER, notificationPlayerID);
80 Resource resource = Resource.Load(m_SpawnPointPrefab);
81 if (!resource || !resource.IsValid())
83 Debug.Error(
string.Format(
"Invalid spawn point resource: %1 in %2::AddSpawnPoint",
84 m_SpawnPointPrefab, Type().ToString()));
89 SCR_PlayerSpawnPoint spawnPoint = SCR_PlayerSpawnPoint.Cast(
GetGame().SpawnEntityPrefab(resource,
GetOwner().GetWorld()));
90 spawnPoint.SetPlayerID(playerID);
94 Debug.Error(
string.Format(
"PlayerSpawnPoint for player: %1 could not be created!", playerID));
104 SCR_PlayerSpawnPoint spawnPoint;
107 RplComponent.DeleteRplEntity(spawnPoint,
false);
124 if (notificationPlayerID > 0)
127 SCR_NotificationsComponent.SendToEveryone(
ENotification.EDITOR_ATTRIBUTES_ENABLE_RESPAWN_ON_RADIO_VEHICLE, notificationPlayerID);
129 SCR_NotificationsComponent.SendToEveryone(
ENotification.EDITOR_ATTRIBUTES_DISABLE_RESPAWN_ON_RADIO_VEHICLE, notificationPlayerID);
134 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
172 if (notificationPlayerID > 0)
175 SCR_NotificationsComponent.SendToEveryone(
ENotification.EDITOR_ATTRIBUTES_ENABLE_DEPLOYABLE_RADIO_SPAWNPOINT, notificationPlayerID);
177 SCR_NotificationsComponent.SendToEveryone(
ENotification.EDITOR_ATTRIBUTES_DISABLE_DEPLOYABLE_RADIO_SPAWNPOINT, notificationPlayerID);
182 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
223 int playerId = requestComponent.GetPlayerId();
224 SCR_PlayerSpawnPoint playerPoint;
226 playerPoint.EnablePoint(playerId, entity);
235 SCR_PlayerSpawnPoint playerPoint;
237 playerPoint.DisablePoint(playerId);
252 bool radioVehicleSpawningEnabled, deployableSpawnPointsEnabled;
254 reader.ReadBool(radioVehicleSpawningEnabled);
255 reader.ReadBool(deployableSpawnPointsEnabled);
266 foreach (
int pointId, SCR_PlayerSpawnPoint spawnPoint :
m_SpawnPoints)
268 RplComponent.DeleteRplEntity(spawnPoint,
false);