fix the ability to kick players who are not loaded
This commit is contained in:
parent
158c6b8a2e
commit
690aa2ba6f
@ -183,6 +183,13 @@ public function bool PlayerIsKickProtected(PlayerReplicationInfo PRI)
|
||||
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)
|
||||
{
|
||||
`Log_Trace();
|
||||
|
@ -10,6 +10,9 @@ var private localized String PlayerIsStartWaveKickProtected;
|
||||
var const String PlayerCantStartKickVoteDefault;
|
||||
var private localized String PlayerCantStartKickVote;
|
||||
|
||||
var const String PlayerPerkIsNotLoadedDefault;
|
||||
var private localized String PlayerPerkIsNotLoaded;
|
||||
|
||||
var const String KickVoteNotEnoughPlayersDefault;
|
||||
var private localized String KickVoteNotEnoughPlayers;
|
||||
|
||||
@ -33,6 +36,7 @@ enum E_CVC_LocalMessageType
|
||||
CVC_PlayerIsKickProtected,
|
||||
CVC_PlayerIsStartWaveKickProtected,
|
||||
CVC_PlayerCantStartKickVote,
|
||||
CVC_PlayerPerkIsNotLoaded,
|
||||
|
||||
CVC_KickVoteNotEnoughPlayers,
|
||||
CVC_KickVoteStarted,
|
||||
@ -88,6 +92,9 @@ public static function String GetLocalizedString(
|
||||
case CVC_PlayerCantStartKickVote:
|
||||
return ReplWaves(default.PlayerCantStartKickVote != "" ? default.PlayerCantStartKickVote : default.PlayerCantStartKickVoteDefault, String1);
|
||||
|
||||
case CVC_PlayerPerkIsNotLoaded:
|
||||
return ReplKickee(default.PlayerPerkIsNotLoaded != "" ? default.PlayerPerkIsNotLoaded : default.PlayerPerkIsNotLoadedDefault, String1);
|
||||
|
||||
case CVC_KickVoteNotEnoughPlayers:
|
||||
return ReplWaves(default.KickVoteNotEnoughPlayers != "" ? default.KickVoteNotEnoughPlayers : default.KickVoteNotEnoughPlayersDefault, String1);
|
||||
|
||||
@ -136,6 +143,7 @@ defaultproperties
|
||||
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)"
|
||||
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)"
|
||||
KickVoteStartedDefault = "<kicker> has started a vote to kick <kickee>"
|
||||
KickVoteStartedForPlayerDefault = "<kicker> started voting to kick you"
|
||||
|
@ -92,6 +92,16 @@ public function ServerStartVoteKick(PlayerReplicationInfo PRI_Kickee, PlayerRepl
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CVC.PlayerPerkLoaded(PRI_Kickee))
|
||||
{
|
||||
CVC.WriteToChatLocalized(
|
||||
KFPC_Kicker,
|
||||
CVC_PlayerPerkIsNotLoaded,
|
||||
CfgKickVote.default.WarningColorHex,
|
||||
KickeeName);
|
||||
return;
|
||||
}
|
||||
|
||||
if (CVC.PlayerIsStartWaveKickProtected(KFPC_Kickee))
|
||||
{
|
||||
CVC.WriteToChatLocalized(
|
||||
|
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user