1
0

Merge branch 'master' into one-player

This commit is contained in:
GenZmeY 2023-06-29 01:40:44 +03:00
commit 1c1b7f6e90
7 changed files with 28 additions and 2 deletions

View File

@ -22,6 +22,7 @@ charset = utf-16le
# Other # Other
[*.md] [*.md]
indent_style = space
trim_trailing_whitespace = false trim_trailing_whitespace = false
[*.yml] [*.yml]

View File

@ -183,6 +183,13 @@ public function bool PlayerIsKickProtected(PlayerReplicationInfo PRI)
return (KickProtectedPlayers.Find('Uid', PRI.UniqueId.Uid) != INDEX_NONE); return (KickProtectedPlayers.Find('Uid', PRI.UniqueId.Uid) != INDEX_NONE);
} }
public function bool PlayerPerkLoaded(PlayerReplicationInfo PRI)
{
`Log_Trace();
return (KFPlayerReplicationInfo(PRI) != None && KFPlayerReplicationInfo(PRI).CurrentPerkClass != None);
}
public function bool PlayerIsStartWaveKickProtected(KFPlayerController KFPC) public function bool PlayerIsStartWaveKickProtected(KFPlayerController KFPC)
{ {
`Log_Trace(); `Log_Trace();

View File

@ -35,7 +35,7 @@ public function AddMutator(Mutator Mut)
if (Mut == Self) return; if (Mut == Self) return;
if (Mut.Class == Class) if (Mut.Class == Class)
Mut.Destroy(); CVCMut(Mut).SafeDestroy();
else else
Super.AddMutator(Mut); Super.AddMutator(Mut);
} }
@ -56,5 +56,5 @@ public function NotifyLogout(Controller C)
defaultproperties defaultproperties
{ {
GroupNames.Add("VoteCollector")
} }

View File

@ -10,6 +10,9 @@ var private localized String PlayerIsStartWaveKickProtected;
var const String PlayerCantStartKickVoteDefault; var const String PlayerCantStartKickVoteDefault;
var private localized String PlayerCantStartKickVote; var private localized String PlayerCantStartKickVote;
var const String PlayerPerkIsNotLoadedDefault;
var private localized String PlayerPerkIsNotLoaded;
var const String KickVoteNotEnoughPlayersDefault; var const String KickVoteNotEnoughPlayersDefault;
var private localized String KickVoteNotEnoughPlayers; var private localized String KickVoteNotEnoughPlayers;
@ -33,6 +36,7 @@ enum E_CVC_LocalMessageType
CVC_PlayerIsKickProtected, CVC_PlayerIsKickProtected,
CVC_PlayerIsStartWaveKickProtected, CVC_PlayerIsStartWaveKickProtected,
CVC_PlayerCantStartKickVote, CVC_PlayerCantStartKickVote,
CVC_PlayerPerkIsNotLoaded,
CVC_KickVoteNotEnoughPlayers, CVC_KickVoteNotEnoughPlayers,
CVC_KickVoteStarted, CVC_KickVoteStarted,
@ -88,6 +92,9 @@ public static function String GetLocalizedString(
case CVC_PlayerCantStartKickVote: case CVC_PlayerCantStartKickVote:
return ReplWaves(default.PlayerCantStartKickVote != "" ? default.PlayerCantStartKickVote : default.PlayerCantStartKickVoteDefault, String1); return ReplWaves(default.PlayerCantStartKickVote != "" ? default.PlayerCantStartKickVote : default.PlayerCantStartKickVoteDefault, String1);
case CVC_PlayerPerkIsNotLoaded:
return ReplKickee(default.PlayerPerkIsNotLoaded != "" ? default.PlayerPerkIsNotLoaded : default.PlayerPerkIsNotLoadedDefault, String1);
case CVC_KickVoteNotEnoughPlayers: case CVC_KickVoteNotEnoughPlayers:
return ReplWaves(default.KickVoteNotEnoughPlayers != "" ? default.KickVoteNotEnoughPlayers : default.KickVoteNotEnoughPlayersDefault, String1); return ReplWaves(default.KickVoteNotEnoughPlayers != "" ? default.KickVoteNotEnoughPlayers : default.KickVoteNotEnoughPlayersDefault, String1);
@ -136,6 +143,7 @@ defaultproperties
PlayerIsKickProtectedDefault = "<kickee> is protected from kick" PlayerIsKickProtectedDefault = "<kickee> is protected from kick"
PlayerIsStartWaveKickProtectedDefault = "You can't kick <kickee> right now. He can be kicked when he plays at least <waves> wave(s)" PlayerIsStartWaveKickProtectedDefault = "You can't kick <kickee> right now. He can be kicked when he plays at least <waves> wave(s)"
PlayerCantStartKickVoteDefault = "You can't start kick vote now. You can start kick vote when you play at least <waves> wave(s)" PlayerCantStartKickVoteDefault = "You can't start kick vote now. You can start kick vote when you play at least <waves> wave(s)"
PlayerPerkIsNotLoadedDefault = "You can't kick a player who hasn't loaded yet (<kickee>)"
KickVoteNotEnoughPlayersDefault = "Not enough players to start vote (only players who have played at least <waves> wave(s) can vote)" KickVoteNotEnoughPlayersDefault = "Not enough players to start vote (only players who have played at least <waves> wave(s) can vote)"
KickVoteStartedDefault = "<kicker> has started a vote to kick <kickee>" KickVoteStartedDefault = "<kicker> has started a vote to kick <kickee>"
KickVoteStartedForPlayerDefault = "<kicker> started voting to kick you" KickVoteStartedForPlayerDefault = "<kicker> started voting to kick you"

View File

@ -92,6 +92,16 @@ public function ServerStartVoteKick(PlayerReplicationInfo PRI_Kickee, PlayerRepl
return; return;
} }
if (!CVC.PlayerPerkLoaded(PRI_Kickee))
{
CVC.WriteToChatLocalized(
KFPC_Kicker,
CVC_PlayerPerkIsNotLoaded,
CfgKickVote.default.WarningColorHex,
KickeeName);
return;
}
if (CVC.PlayerIsStartWaveKickProtected(KFPC_Kickee)) if (CVC.PlayerIsStartWaveKickProtected(KFPC_Kickee))
{ {
CVC.WriteToChatLocalized( CVC.WriteToChatLocalized(

Binary file not shown.

Binary file not shown.