Arizard / deathrun

Arizard's Deathrun gamemode for Garry's Mod
63 stars 38 forks source link

Deathrun Ghost Mode #37

Closed MrDeadNight closed 8 years ago

MrDeadNight commented 8 years ago

Anyway to change the color shown on the scoreboard shown for people in ghostmode because I am getting a really bright yellow and would really like to change it to something else

SunRed commented 8 years ago

Currently, the colour is set here by using team.GetColor. The team color may be set in your GhostMode addon anywhere where team.SetColor is used.

Without changing anything in your gamemode or addon, you could try something like

hook.Add('PostGamemodeLoaded', 'ChangeGhostTeamColor', function()
    if team.Valid(TEAM_GHOST) then
        local teamcolor = '#000000' -- change the hexcode to your preference
        team.SetColor(TEAM_GHOST, HexColor(teamcolor))
        print("Set ghost team color to " .. teamcolor) -- may help debugging
    end
end)

in a shared lua file anywhere, like in a new addon (lua/autorun) or somewhere else. Since I am not using the GhostMode addon, I am not able to test the code snippet.

Arizard commented 8 years ago

this is correct