@@ -976,6 +976,138 @@ CON_COMMAND_CHAT_FLAGS(listdc, "- List recently disconnected players and their S
976976 g_pAdminSystem->ShowDisconnectedPlayers (player);
977977}
978978
979+ CON_COMMAND_CHAT_FLAGS (endround, " - Immediately ends the round, client-side variant of endround" , ADMFLAG_RCON)
980+ {
981+ g_pGameRules->TerminateRound (0 .0f , CSRoundEndReason::Draw);
982+ }
983+
984+ CON_COMMAND_CHAT_FLAGS (money, " <name> <amount> - Set a player's amount of money" , ADMFLAG_CHEATS)
985+ {
986+ if (args.ArgC () < 3 )
987+ {
988+ ClientPrint (player, HUD_PRINTTALK, CHAT_PREFIX " Usage: !money <name> <amount>" );
989+ return ;
990+ }
991+
992+ int iMoney = V_StringToInt32 (args[2 ], -1 );
993+
994+ if (iMoney < 0 )
995+ {
996+ ClientPrint (player, HUD_PRINTTALK, CHAT_PREFIX " Invalid amount specified, must be a positive number." );
997+ return ;
998+ }
999+
1000+ int iNumClients = 0 ;
1001+ int pSlots[MAXPLAYERS];
1002+ ETargetType nType;
1003+
1004+ if (!g_playerManager->CanTargetPlayers (player, args[1 ], iNumClients, pSlots, NO_TARGET_BLOCKS, nType))
1005+ return ;
1006+
1007+ const char * pszCommandPlayerName = player ? player->GetPlayerName () : CONSOLE_NAME;
1008+
1009+ char szAction[64 ];
1010+ V_snprintf (szAction, sizeof (szAction), " set $%i money on" , iMoney);
1011+
1012+ for (int i = 0 ; i < iNumClients; i++)
1013+ {
1014+ CCSPlayerController* pTarget = CCSPlayerController::FromSlot (pSlots[i]);
1015+
1016+ if (!pTarget)
1017+ continue ;
1018+
1019+ pTarget->m_pInGameMoneyServices ->m_iAccount = iMoney;
1020+
1021+ if (iNumClients == 1 )
1022+ PrintSingleAdminAction (pszCommandPlayerName, pTarget->GetPlayerName (), szAction, " " );
1023+ }
1024+
1025+ if (iNumClients > 1 )
1026+ PrintMultiAdminAction (nType, pszCommandPlayerName, szAction, " " );
1027+ }
1028+
1029+ CON_COMMAND_CHAT_FLAGS (health, " <name> <health> - Set a player's health" , ADMFLAG_CHEATS)
1030+ {
1031+ if (args.ArgC () < 3 )
1032+ {
1033+ ClientPrint (player, HUD_PRINTTALK, CHAT_PREFIX " Usage: !health <name> <health>" );
1034+ return ;
1035+ }
1036+
1037+ int iHealth = V_StringToInt32 (args[2 ], -1 );
1038+
1039+ if (iHealth < 1 )
1040+ {
1041+ ClientPrint (player, HUD_PRINTTALK, CHAT_PREFIX " Invalid amount specified, must be a positive number." );
1042+ return ;
1043+ }
1044+
1045+ int iNumClients = 0 ;
1046+ int pSlots[MAXPLAYERS];
1047+ ETargetType nType;
1048+
1049+ if (!g_playerManager->CanTargetPlayers (player, args[1 ], iNumClients, pSlots, NO_DEAD | NO_SPECTATOR, nType))
1050+ return ;
1051+
1052+ const char * pszCommandPlayerName = player ? player->GetPlayerName () : CONSOLE_NAME;
1053+
1054+ char szAction[64 ];
1055+ V_snprintf (szAction, sizeof (szAction), " set %i health on" , iHealth);
1056+
1057+ for (int i = 0 ; i < iNumClients; i++)
1058+ {
1059+ CCSPlayerController* pTarget = CCSPlayerController::FromSlot (pSlots[i]);
1060+
1061+ if (!pTarget)
1062+ continue ;
1063+
1064+ CCSPlayerPawn* pPawn = pTarget->GetPlayerPawn ();
1065+
1066+ if (!pPawn)
1067+ continue ;
1068+
1069+ if (pPawn->m_iMaxHealth < iHealth)
1070+ pPawn->m_iMaxHealth = iHealth;
1071+
1072+ pPawn->m_iHealth = iHealth;
1073+
1074+ if (iNumClients == 1 )
1075+ PrintSingleAdminAction (pszCommandPlayerName, pTarget->GetPlayerName (), szAction, " " );
1076+ }
1077+
1078+ if (iNumClients > 1 )
1079+ PrintMultiAdminAction (nType, pszCommandPlayerName, szAction, " " );
1080+ }
1081+
1082+ CON_COMMAND_CHAT_FLAGS (setpos, " <x y z> - Set your origin" , ADMFLAG_CHEATS)
1083+ {
1084+ if (!player)
1085+ {
1086+ ClientPrint (player, HUD_PRINTTALK, CHAT_PREFIX " You cannot use this command from the server console." );
1087+ return ;
1088+ }
1089+
1090+ CBasePlayerPawn* pPawn = player->GetPawn ();
1091+
1092+ if (!pPawn)
1093+ return ;
1094+
1095+ if (pPawn->m_iTeamNum () < CS_TEAM_T || !pPawn->IsAlive ())
1096+ {
1097+ ClientPrint (player, HUD_PRINTTALK, CHAT_PREFIX " You must be alive to use this command." );
1098+ return ;
1099+ }
1100+
1101+ Vector origin;
1102+ V_StringToVector (args.ArgS (), origin);
1103+
1104+ char szOrigin[64 ];
1105+ V_snprintf (szOrigin, sizeof (szOrigin), " %f %f %f" , origin.x , origin.y , origin.z );
1106+
1107+ pPawn->Teleport (&origin, nullptr , nullptr );
1108+ PrintSingleAdminAction (player->GetPlayerName (), szOrigin, " teleported to" );
1109+ }
1110+
9791111#ifdef _DEBUG
9801112CON_COMMAND_CHAT_FLAGS (add_dc, " <name> <SteamID 64> <IP Address> - Adds a fake player to disconnected player list for testing" , ADMFLAG_GENERIC)
9811113{
0 commit comments