Skip to content

Commit

Permalink
Merge pull request #59 from 2called-chaos/fix_colors
Browse files Browse the repository at this point in the history
Fix colors (resolves #55 and resolves #12)
  • Loading branch information
nikooo777 authored Oct 18, 2017
2 parents 188ccc2 + b86acfc commit c0eaa6c
Show file tree
Hide file tree
Showing 8 changed files with 1,063 additions and 961 deletions.
3 changes: 1 addition & 2 deletions csgo/addons/sourcemod/configs/ckSurf/custom_chat_titles.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Custom titles for ckSurf
// Available colors: {default}, {green}, {mossgreen}, {limegreen}, {gray}, {yellow}, {orange}, {darkgray}, {blue}, {darkblue}, {purple}, {lightblue}, {pink}, {lightred}, {darkred}, {red}
// Known issues: Orange and Purple won't work if they are at the start of the title_name
// Available colors: {default}, {red}, {lightred}, {darkred}, {bluegray}, {blue}, {darkblue}, {purple}, {orchid}, {yellow}, {gold}, {lightgreen}, {green}, {lime}, {gray}, {gray2}
//
// The first title grants access to the !vip menu
//
Expand Down
3 changes: 1 addition & 2 deletions csgo/addons/sourcemod/configs/ckSurf/skillgroups.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
//
// Max rank lenght: 32 characters
// Always keep ranks in ascending order by percentage
// Available colors: {default}, {darkred}, {green}, {lightgreen}, {orange}, {blue}, {olive}, {lime}, {red}, {purple}, {grey}, {yellow}, {lightblue}, {steelblue}, {darkblue}, {pink}, {lightred}
// Known issues: Orange and Purple won't work if they are at the start of the rank name
// Available colors: {default}, {red}, {lightred}, {darkred}, {bluegray}, {blue}, {darkblue}, {purple}, {orchid}, {yellow}, {gold}, {lightgreen}, {green}, {lime}, {gray}, {gray2}

// name -> the text you will see as rank (can be colored with multiple colors as well)
// percentage -> the percent required to get that rank title
Expand Down
4 changes: 2 additions & 2 deletions csgo/addons/sourcemod/scripting/ckSurf.sp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <smlib>
#include <geoip>
#include <basecomm>
#include <colors>
#include <colorvariables>
#undef REQUIRE_EXTENSIONS
#include <clientprefs>
#undef REQUIRE_PLUGIN
Expand Down Expand Up @@ -1704,7 +1704,7 @@ public void OnPluginStart()
g_hDynamicTimelimit = CreateConVar("ck_dynamic_timelimit", "0", "on/off - Sets a suitable timelimit by calculating the average run time (This method requires ck_map_end 1, greater than 5 map times and a default timelimit in your server config for maps with less than 5 times", FCVAR_NOTIFY, true, 0.0, true, 1.0);
g_hExtraPoints = CreateConVar("ck_ranking_extra_points_improvements", "15.0", "Gives players x extra points for improving their time", FCVAR_NOTIFY, true, 0.0, true, 100.0);
g_hExtraPoints2 = CreateConVar("ck_ranking_extra_points_firsttime", "50.0", "Gives players x extra points for finishing a map for the first time", FCVAR_NOTIFY, true, 0.0, true, 100.0);
g_hWelcomeMsg = CreateConVar("ck_welcome_msg", " {yellow}>>{default} {grey}Welcome! This server is using {lime}ckSurf", "Welcome message (supported color tags: {default}, {darkred}, {green}, {lightgreen}, {orange}, {blue}, {olive}, {lime}, {red}, {purple}, {grey}, {yellow}, {lightblue}, {steelblue}, {darkblue}, {pink}, {lightred})", FCVAR_NOTIFY);
g_hWelcomeMsg = CreateConVar("ck_welcome_msg", " {yellow}>>{default} {grey}Welcome! This server is using {lime}ckSurf", "Welcome message (supported color tags: {default}, {red}, {lightred}, {darkred}, {bluegray}, {blue}, {darkblue}, {purple}, {orchid}, {yellow}, {gold}, {lightgreen}, {green}, {lime}, {gray}, {gray2})", FCVAR_NOTIFY);
g_hChecker = CreateConVar("ck_zone_checker", "5.0", "The duration in seconds when the beams around zones are refreshed", FCVAR_NOTIFY);
g_hZoneDisplayType = CreateConVar("ck_zone_drawstyle", "1", "0 = Do not display zones, 1 = display the lower edges of zones, 2 = display whole zones", FCVAR_NOTIFY);
g_hZonesToDisplay = CreateConVar("ck_zone_drawzones", "1", "Which zones are visible for players. 1 = draw start & end zones, 2 = draw start, end, stage and bonus zones, 3 = draw all zones", FCVAR_NOTIFY);
Expand Down
2 changes: 1 addition & 1 deletion csgo/addons/sourcemod/scripting/ckSurf/commands.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1966,7 +1966,7 @@ public Action Client_Ranks(int client, int args)
}
Format(ChatLine, 512, "%s%s%c (%ip) ", ChatLine, RankValue[RankNameColored], WHITE, RankValue[PointReq]);
}
PrintToChat(client, ChatLine);
CPrintToChat(client, ChatLine);
}
return Plugin_Handled;
}
Expand Down
4 changes: 2 additions & 2 deletions csgo/addons/sourcemod/scripting/ckSurf/hooks.sp
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ public Action Say_Hook(int client, const char[] command, int argc)
if (GetConVarBool(g_hCountry) && (GetConVarBool(g_hPointSystem) || (StrEqual(g_pr_rankname[client], "ADMIN", false) && GetConVarBool(g_hAdminClantag))))
{
if (IsPlayerAlive(client))
CPrintToChatAll("{green}%s{default} %s {teamcolor}%s{default}: %s", g_szCountryCode[client], szChatRank, szName, sText);
CPrintToChatAll("{green}%s{default} %s {default}%s{default}: %s", g_szCountryCode[client], szChatRank, szName, sText);
else
CPrintToChatAll("{green}%s{default} %s {teamcolor}*DEAD* %s{default}: %s", g_szCountryCode[client], szChatRank, szName, sText);
CPrintToChatAll("{green}%s{default} %s {default}*DEAD* %s{default}: %s", g_szCountryCode[client], szChatRank, szName, sText);
return Plugin_Handled;
}
else
Expand Down
9 changes: 1 addition & 8 deletions csgo/addons/sourcemod/scripting/ckSurf/misc.sp
Original file line number Diff line number Diff line change
Expand Up @@ -599,14 +599,7 @@ public bool loadCustomTitles()

public void normalizeChatString(char[] ParseString, int size)
{
//players are using special ASCII chars to simulate 0x** colors
//this will prevent it by replacing ASCII characters outside of the normal range with a space
//CTag comes from colors.inc
for (int i = 0 ; i < MAX_COLORS ; i++)
{
ReplaceString(ParseString, size, CTag[i], "", false);
ReplaceString(ParseString, size, CTagCode[i],"",false);
}
CRemoveColors(ParseString, size);
}

public void checkChangesInTitle(int client)
Expand Down
Loading

0 comments on commit c0eaa6c

Please sign in to comment.