Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.

Commit 467a0b5

Browse files
authored
Merge pull request #53 from marqdevx/marqdevx/teammate-color
Add `.color` command to change player's color
2 parents 49899f3 + feeadc2 commit 467a0b5

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/commands.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,18 @@ CON_COMMAND_CHAT(myuid, "test")
390390
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "Your userid is %i, slot: %i, retrieved slot: %i", g_pEngineServer2->GetPlayerUserId(iPlayer).Get(), iPlayer, g_playerManager->GetSlotFromUserId(g_pEngineServer2->GetPlayerUserId(iPlayer).Get()));
391391
}
392392

393+
CON_COMMAND_CHAT(color, "Set player's hud color") {
394+
if (!player)
395+
return;
396+
397+
if (args.ArgC() < 2){
398+
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "Usage .color <1-5>");
399+
return;
400+
}
401+
402+
player->m_iCompTeammateColor = atoi(args[1]) % 5;
403+
}
404+
393405
bool match_paused = false;
394406
bool ct_ready = true;
395407
bool t_ready = true;

src/cs2_sdk/entity/ccsplayercontroller.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class CCSPlayerController : public CBasePlayerController
3333
SCHEMA_FIELD(CCSPlayerController_InGameMoneyServices*, m_pInGameMoneyServices)
3434
SCHEMA_FIELD(CCSPlayerController_ActionTrackingServices*, m_pActionTrackingServices)
3535
SCHEMA_FIELD(CUtlSymbolLarge, m_szClan)
36+
SCHEMA_FIELD(int32_t , m_iCompTeammateColor);
3637
SCHEMA_FIELD(bool, m_bPawnIsAlive);
3738
SCHEMA_FIELD(CHandle<CCSPlayerPawn>, m_hPlayerPawn);
3839

0 commit comments

Comments
 (0)