return s;\r
}\r
\r
+string Team_ColorCode(float teamid)\r
+{\r
+ if (teamid == COLOR_TEAM1)\r
+ return "^1";\r
+ else if (teamid == COLOR_TEAM2)\r
+ return "^4";\r
+ else if (teamid == COLOR_TEAM3)\r
+ return "^3";\r
+ else if (teamid == COLOR_TEAM4)\r
+ return "^6";\r
+ else\r
+ return "^7";\r
+}\r
+\r
+// decolorizes and team colors the player name when needed\r
+string playername(string thename, float teamid)\r
+{\r
+ string t;\r
+ if (teamplay)\r
+ {\r
+ t = Team_ColorCode(teamid);\r
+ return strcat(t, strdecolorize(thename));\r
+ }\r
+ else\r
+ return strdecolorize(thename);\r
+}\r
+\r
float cvar_or(string cv, float v)\r
{\r
string s;\r
R_EndPolygon();\r
}\r
}\r
+\r
+const vector GETPLAYERORIGIN_ERROR = '1123581321 2357111317 3141592653'; // way out of bounds for anything on the map\r
+vector getplayerorigin(float pl)\r
+{\r
+ string s;\r
+ entity e;\r
+\r
+ s = getplayerkey(pl, "TEMPHACK_origin");\r
+ if(s != "")\r
+ return stov(s);\r
+\r
+ e = entcs_receiver[pl];\r
+ if(e)\r
+ return e.origin;\r
+\r
+ return GETPLAYERORIGIN_ERROR;\r
+}\r