Skip to content

Commit

Permalink
More commands
Browse files Browse the repository at this point in the history
  • Loading branch information
OfficerSpy committed Dec 14, 2024
1 parent 486f009 commit fe07bbe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/redbots3/util.sp
Original file line number Diff line number Diff line change
Expand Up @@ -563,14 +563,14 @@ int GetAcquiredCreditsOfAllWaves(bool withBonus = true)
return 0;
}

int total = GetEntProp(ent, Prop_Send, "m_runningTotalWaveStats", _, STATS_CREDITS_ACQUIRED)
total += GetEntProp(ent, Prop_Send, "m_previousWaveStats", _, STATS_CREDITS_ACQUIRED)
int total = GetEntProp(ent, Prop_Send, "m_runningTotalWaveStats", _, STATS_CREDITS_ACQUIRED);
total += GetEntProp(ent, Prop_Send, "m_previousWaveStats", _, STATS_CREDITS_ACQUIRED);
total += GetEntProp(ent, Prop_Send, "m_currentWaveStats", _, STATS_CREDITS_ACQUIRED);

if (withBonus)
{
total += GetEntProp(ent, Prop_Send, "m_runningTotalWaveStats", _, STATS_CREDITS_BONUS)
total += GetEntProp(ent, Prop_Send, "m_previousWaveStats", _, STATS_CREDITS_BONUS)
total += GetEntProp(ent, Prop_Send, "m_runningTotalWaveStats", _, STATS_CREDITS_BONUS);
total += GetEntProp(ent, Prop_Send, "m_previousWaveStats", _, STATS_CREDITS_BONUS);
total += GetEntProp(ent, Prop_Send, "m_currentWaveStats", _, STATS_CREDITS_BONUS);
}

Expand Down
18 changes: 18 additions & 0 deletions source/tf2_defenderbots.sp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ public void OnPluginStart()
#endif

RegAdminCmd("sm_addbots", Command_AddBots, ADMFLAG_GENERIC);
RegAdminCmd("sm_purgebots", Command_RemoveAllBots, ADMFLAG_GENERIC);
RegAdminCmd("sm_botmanager_stop", Command_StopManagingBots, ADMFLAG_GENERIC);
RegAdminCmd("sm_view_bot_upgrades", Command_ViewBotUpgrades, ADMFLAG_GENERIC);

AddCommandListener(Listener_TournamentPlayerReadystate, "tournament_player_readystate");
Expand Down Expand Up @@ -917,6 +919,22 @@ public Action Command_AddBots(int client, int args)
return Plugin_Handled;
}

public Action Command_RemoveAllBots(int client, int args)
{
RemoveAllDefenderBots("Admin request");
ShowActivity2(client, "[SM] ", "%N purged all bots", client);

return Plugin_Handled;
}

public Action Command_StopManagingBots(int client, int args)
{
ManageDefenderBots(false);
ReplyToCommand(client, "Stopped manaing bots.");

return Plugin_Handled;
}

public Action Command_ViewBotUpgrades(int client, int args)
{
if (args < 1)
Expand Down

0 comments on commit fe07bbe

Please sign in to comment.