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

Add .color command to change player's color #53

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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