Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CleanSweepNetworkComponent.c
Go to the documentation of this file.
1 [EntityEditorProps(category: "GameScripted/CleanSweep", description: "A character clean sweep component for comunication from client to server.", color: "0 0 255 255")]
2 class SCR_CleanSweepNetworkComponentClass: ScriptComponentClass
3 {
4 }
5 
7 {
8 
9  //------------------------------------------------------------------------------------------------
12  {
13  Rpc(RPC_CommitSuicide);
14  }
15 
16  //------------------------------------------------------------------------------------------------
19  {
21  }
22 
23  //------------------------------------------------------------------------------------------------
27  void ChooseArea(int areaID, bool swapSides)
28  {
29  Rpc(RPC_ChooseArea, areaID, swapSides);
30  }
31 
32  //------------------------------------------------------------------------------------------------
34  void SetControlledEntityOrigin(vector origin)
35  {
36  Rpc(RPC_SetControlledEntityOrigin, origin);
37  }
38 
39  //------------------------------------------------------------------------------------------------
40  [RplRpc(RplChannel.Reliable, RplRcver.Owner)]
41  protected void RPC_CommitSuicide()
42  {
44  if (!playerController)
45  return;
46 
47  GenericEntity controlledEntity = GenericEntity.Cast(playerController.GetMainEntity());
48  if (!controlledEntity)
49  return;
50 
51  CharacterControllerComponent controllerComponent = CharacterControllerComponent.Cast(controlledEntity.FindComponent(CharacterControllerComponent));
52  if (!controllerComponent)
53  return;
54 
55  controllerComponent.ForceDeath();
56  }
57 
58  //------------------------------------------------------------------------------------------------
59  [RplRpc(RplChannel.Reliable, RplRcver.Owner)]
60  protected void RPC_SetControlledEntityOrigin(vector origin)
61  {
62  IEntity controlledEntity = SCR_PlayerController.GetLocalControlledEntity();
63  if (!controlledEntity)
64  return;
65 
66  controlledEntity.SetOrigin(origin);
67  }
68 
69  //------------------------------------------------------------------------------------------------
70  [RplRpc(RplChannel.Reliable, RplRcver.Owner)]
71  protected void RPC_ShowAreaSelectionScreen()
72  {
74  if (!cleanSweep)
75  return;
76 
77  cleanSweep.ShowAreaSelectionUI();
78  }
79 
80  //------------------------------------------------------------------------------------------------
81  [RplRpc(RplChannel.Reliable, RplRcver.Server)]
82  protected void RPC_ChooseArea(int areaID, bool swapSides)
83  {
85  if (!cleanSweep)
86  return;
87 
88  cleanSweep.SetSwapSides(swapSides);
89  cleanSweep.SetArea(areaID);
90  }
91 
92  //------------------------------------------------------------------------------------------------
93  // constructor
97  void SCR_CleanSweepNetworkComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
98  {
99  }
100 }
SCR_PlayerController
Definition: SCR_PlayerController.c:31
RPC_ShowAreaSelectionScreen
protected void RPC_ShowAreaSelectionScreen()
Definition: SCR_CleanSweepNetworkComponent.c:71
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
ScriptComponent
SCR_SiteSlotEntityClass ScriptComponent
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
RPC_CommitSuicide
protected void RPC_CommitSuicide()
Definition: SCR_CleanSweepNetworkComponent.c:41
RplRpc
SCR_AchievementsHandlerClass ScriptComponentClass RplRpc(RplChannel.Reliable, RplRcver.Owner)] void UnlockOnClient(AchievementId achievement)
Definition: SCR_AchievementsHandler.c:11
GenericEntity
SCR_GenericBoxEntityClass GenericEntity
ShowAreaSelectionScreen
void ShowAreaSelectionScreen()
Definition: SCR_CleanSweepNetworkComponent.c:18
GetPlayerController
proto external PlayerController GetPlayerController()
Definition: SCR_PlayerDeployMenuHandlerComponent.c:307
SetControlledEntityOrigin
void SetControlledEntityOrigin(vector origin)
Definition: SCR_CleanSweepNetworkComponent.c:34
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition: SCR_BaseGameModeComponent.c:15
RPC_SetControlledEntityOrigin
protected void RPC_SetControlledEntityOrigin(vector origin)
Definition: SCR_CleanSweepNetworkComponent.c:60
SCR_CleanSweepNetworkComponentClass
Definition: SCR_CleanSweepNetworkComponent.c:2
ChooseArea
void ChooseArea(int areaID, bool swapSides)
Definition: SCR_CleanSweepNetworkComponent.c:27
SCR_GameModeCleanSweep
Definition: SCR_GameModeCleanSweep.c:7
RPC_ChooseArea
protected void RPC_ChooseArea(int areaID, bool swapSides)
Definition: SCR_CleanSweepNetworkComponent.c:82
CommitSuicide
SCR_CleanSweepNetworkComponentClass ScriptComponentClass CommitSuicide()
Definition: SCR_CleanSweepNetworkComponent.c:11
SCR_CleanSweepNetworkComponent
void SCR_CleanSweepNetworkComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_CleanSweepNetworkComponent.c:97
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180