Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
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")]
5
7{
8
9 //------------------------------------------------------------------------------------------------
11 void CommitSuicide()
12 {
14 }
15
16 //------------------------------------------------------------------------------------------------
22
23 //------------------------------------------------------------------------------------------------
27 void ChooseArea(int areaID, bool swapSides)
28 {
29 Rpc(RPC_ChooseArea, areaID, swapSides);
30 }
31
32 //------------------------------------------------------------------------------------------------
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)]
61 {
63 if (!controlledEntity)
64 return;
65
66 controlledEntity.SetOrigin(origin);
67 }
68
69 //------------------------------------------------------------------------------------------------
70 [RplRpc(RplChannel.Reliable, RplRcver.Owner)]
72 {
73 SCR_GameModeCleanSweep cleanSweep = SCR_GameModeCleanSweep.Cast(GetGame().GetGameMode());
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 {
84 SCR_GameModeCleanSweep cleanSweep = SCR_GameModeCleanSweep.Cast(GetGame().GetGameMode());
85 if (!cleanSweep)
86 return;
87
88 cleanSweep.SetSwapSides(swapSides);
89 cleanSweep.SetArea(areaID);
90 }
91
92 //------------------------------------------------------------------------------------------------
93 // constructor
100}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_BaseGameMode GetGameMode()
void ChooseArea(int areaID, bool swapSides)
void RPC_CommitSuicide()
void SetControlledEntityOrigin(vector origin)
void SCR_CleanSweepNetworkComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
void RPC_SetControlledEntityOrigin(vector origin)
void ShowAreaSelectionScreen()
SCR_CleanSweepNetworkComponentClass ScriptComponentClass CommitSuicide()
void RPC_ShowAreaSelectionScreen()
void RPC_ChooseArea(int areaID, bool swapSides)
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
void Rpc(func method, void p0=NULL, void p1=NULL, void p2=NULL, void p3=NULL, void p4=NULL, void p5=NULL, void p6=NULL, void p7=NULL)
proto external Managed FindComponent(typename typeName)
proto external void SetOrigin(vector orig)
static IEntity GetLocalControlledEntity()
proto external PlayerController GetPlayerController()
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
Definition EnNetwork.c:95
RplRcver
Definition RplRcver.c:59
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.
Definition RplChannel.c:14