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

Commit

Permalink
Merge pull request #53 from marqdevx/marqdevx/teammate-color
Browse files Browse the repository at this point in the history
Add `.color` command to change player's color
  • Loading branch information
marqdevx authored Apr 22, 2024
2 parents 49899f3 + feeadc2 commit 467a0b5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,18 @@ CON_COMMAND_CHAT(myuid, "test")
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()));
}

CON_COMMAND_CHAT(color, "Set player's hud color") {
if (!player)
return;

if (args.ArgC() < 2){
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "Usage .color <1-5>");
return;
}

player->m_iCompTeammateColor = atoi(args[1]) % 5;
}

bool match_paused = false;
bool ct_ready = true;
bool t_ready = true;
Expand Down
1 change: 1 addition & 0 deletions src/cs2_sdk/entity/ccsplayercontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class CCSPlayerController : public CBasePlayerController
SCHEMA_FIELD(CCSPlayerController_InGameMoneyServices*, m_pInGameMoneyServices)
SCHEMA_FIELD(CCSPlayerController_ActionTrackingServices*, m_pActionTrackingServices)
SCHEMA_FIELD(CUtlSymbolLarge, m_szClan)
SCHEMA_FIELD(int32_t , m_iCompTeammateColor);
SCHEMA_FIELD(bool, m_bPawnIsAlive);
SCHEMA_FIELD(CHandle<CCSPlayerPawn>, m_hPlayerPawn);

Expand Down

0 comments on commit 467a0b5

Please sign in to comment.