rott/kf_sources/KFGui/Classes/KFRemoveBotButton.uc
2026-07-14 20:27:09 +07:00

37 lines
855 B
Ucode

class KFRemoveBotButton extends moButton;
function bool InternalOnClick(GUIComponent Sender)
{
local int PendingBots;
local KFGameReplicationInfo KFGRI;
local String BotName;
KFGRI = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo);
if (KFGRI == none)
return false;
PendingBots = KFGRI.PendingBots;
if (PendingBots > 0)
{
PlayerOwner().ClientMessage("A bot was removed from pending BotList");
PlayerOwner().ClientMessage("Number of bots left: "$KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).PendingBots );
KFPlayerController(PlayerOwner()).GRIKillBotCall(1);
PendingBots --;
BotName = "";
}
KFPlayerController(PlayerOwner()).ServerSetGRIPendingBots(PendingBots,BotName);
}
defaultproperties
{
ButtonCaption="Remove Bot"
}