1[
EntityEditorProps(
category:
"GameScripted/GameMode", description:
"Takes care of player penalties, kicks, bans etc.", color:
"0 0 255 255")]
27 protected static const int EVALUATION_PERIOD = 1000;
50 if (!instigatorContextData.DoesPlayerKillCountAsTeamKill() && !instigatorContextData.IsEnemyKillPunished(SCR_EDisguisedKillingPunishment.WARCRIME))
54 int killerPlayerId = instigator.GetInstigatorPlayerID();
57 switch (victimControlType)
65 if (playerPenaltyData)
76 if (playerPenaltyData)
96 static SCR_ChimeraCharacter GetInstigatorFromVehicle(
IEntity veh,
bool gunner =
false)
98 BaseCompartmentManagerComponent compartmentManager = BaseCompartmentManagerComponent.Cast(veh.
FindComponent(BaseCompartmentManagerComponent));
100 if (!compartmentManager)
103 array<BaseCompartmentSlot> compartments =
new array <BaseCompartmentSlot>();
105 for (
int i = 0, cnt = compartmentManager.GetCompartments(compartments); i < cnt; i++)
107 BaseCompartmentSlot slot = compartments[i];
109 if (slot && (!gunner && slot.Type() == PilotCompartmentSlot) || (gunner && slot.Type() == TurretCompartmentSlot))
110 return SCR_ChimeraCharacter.Cast(slot.GetOccupant());
136 if (playerPenaltyData)
137 return playerPenaltyData;
140 PlayerController pc =
GetGame().GetPlayerManager().GetPlayerController(playerId);
144 Print(
string.Format(
"SCR_PlayerPenaltyComponent: No player with playerId %1 found.", playerId),
LogLevel.ERROR);
153 return playerPenaltyData;
207 if (playerPenaltyData)
210 GetGame().GetPlayerManager().KickPlayer(playerId,
reason, duration);
228 void SCR_LocalPlayerPenalty(
int friendlyPlayerKillPenalty,
int friendlyAIKillPenalty,
int penaltyLimit,
int banDuration,
int penaltySubtractionPeriod,
int penaltySubtractionPoints)
238 Print(
"SCR_PlayerPenaltyComponent: Ban duration is shorter than Penalty substraction period. This will cause the player to remain banned until their penalty is substracted.",
LogLevel.WARNING);
ArmaReforgerScripted GetGame()
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
SCR_ECharacterControlType
What kind of controller the character or (in some cases vehicle) has, eg: AI, Player,...
void KickPlayer(int playerId, int duration, SCR_PlayerManagerKickReason reason)
int m_iFriendlyAIKillPenalty
void EvaluatePlayerPenalties()
void OnControllableDestroyed(IEntity entity, IEntity killerEntity, Instigator instigator, notnull SCR_InstigatorContextData instigatorContextData)
int m_iPenaltySubtractionPeriod
SCR_LocalPlayerPenaltyData GetPlayerPenaltyData(int playerId)
ref array< ref SCR_LocalPlayerPenaltyData > m_aPlayerPenaltyData
SCR_LocalPlayerPenaltyClass m_iFriendlyPlayerKillPenalty
int m_iPenaltySubtractionPoints
int GetPenaltySubtractionPeriod()
void SCR_LocalPlayerPenalty(int friendlyPlayerKillPenalty, int friendlyAIKillPenalty, int penaltyLimit, int banDuration, int penaltySubtractionPeriod, int penaltySubtractionPoints)
SCR_PlayerManagerKickReason
SCR_SpawnerSlotManagerClass s_Instance
Class used for managing changes and removals of slots present in world.
enum EVehicleType IEntity
proto external Managed FindComponent(typename typeName)
WorldTimestamp GetNextPenaltySubtractionTimestamp()
void AddPenaltyScore(int points)
SCR_PlayerManagerKickReason m_eKickReason
void SetPlayerId(int playerId)
void SetNextPenaltySubstractionTimestamp(WorldTimestamp timestamp)
WorldTimestamp m_fNextPenaltySubtractionTimestamp
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
proto external PlayerController GetPlayerController()
void OnPlayerConnected(int playerId)
proto external int GetPlayerId()