string getrecords(float page) // 50 records per page
{
- float rec, r, i;
+ float rec = 0, r, i;
string h, s;
+
+ s = "";
if (g_ctf)
{
{
r = stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, "/captimerecord/time")));
- if (r == 0)
+ if not(r)
continue;
// TODO: uid2name
{
r = race_readTime(MapInfo_Map_bspname, 1);
- if (r == 0)
+ if not(r)
continue;
h = race_readName(MapInfo_Map_bspname, 1);
{
r = race_readTime(MapInfo_Map_bspname, 1);
- if (r == 0)
+ if not(r)
continue;
h = race_readName(MapInfo_Map_bspname, 1);
MapInfo_ClearTemps();
- if (s == "" && page == 0)
+ if(s == "" && page == 0)
return "No records are available on this server.\n";
else
return s;
map = GetMapname();
+ s = "";
for (i = 1; i <= RANKINGS_CNT; ++i)
{
t = race_readTime(map, i);
continue;
n = race_readName(map, i);
- p = race_placeName(i);
+ p = count_ordinal(i);
s = strcat(s, strpad(8, p), " ", strpad(-8, TIME_ENCODED_TOSTRING(t)), " ", n, "\n");
}
string getladder()
{
- float i, j, k, uidcnt, thiscnt;
+ float i, j, k, uidcnt = 0, thiscnt;
string s, temp_s, rr, myuid, thisuid;
if(g_cts)
s = strcat(s, " ^7Total ^3|");
for(i = 1; i <= LADDER_CNT; ++i)
- { s = strcat(s, " ^7", race_placeName(i), " ^3|"); }
+ { s = strcat(s, " ^7", count_ordinal(i), " ^3|"); }
s = strcat(s, " ^7Speed awards ^3| ^7Name");
s = strcat(s, "\n^3----+--------");
if(argv(LADDER_CNT+1) == "") // total is 0, skip
continue;
- s = strcat(s, strpad(4, race_placeName(i+1)), "^3| ^7"); // pos
+ s = strcat(s, strpad(4, count_ordinal(i+1)), "^3| ^7"); // pos
s = strcat(s, strpad(7, argv(LADDER_CNT+1)), "^3| ^7"); // total
for(j = 1; j <= min(9, LADDER_CNT); ++j)
return "No ladder on this server!\n";
else
return strcat("Top ", ftos(LADDER_SIZE), " ladder rankings:\n", s);
-}
\ No newline at end of file
+}
+
+string getmaplist()
+{
+ //print("^1================= Executing getmaplist()! =================\n");
+
+ string maplist = "", col;
+ float i, argc;
+
+ argc = tokenize_console(autocvar_g_maplist);
+ for(i = 0; i < argc; ++i)
+ {
+ if(MapInfo_CheckMap(argv(i)))
+ {
+ if(mod(i, 2)) { col = "^2"; }
+ else { col = "^3"; }
+ maplist = sprintf("%s%s%s ", maplist, col, argv(i));
+ }
+ }
+
+ MapInfo_ClearTemps();
+ return sprintf("^7Maps in list: %s\n", maplist);
+}
+
+
+string getlsmaps()
+{
+ //print("^1================= Executing getlsmaps()! =================\n");
+
+ string lsmaps = "", col;
+ float i;
+
+ for(i = 0; i < MapInfo_count; ++i)
+ {
+ if((MapInfo_Get_ByID(i)) && !(MapInfo_Map_flags & MapInfo_ForbiddenFlags()))
+ {
+ if(
+ (g_race && !stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, RACE_RECORD, "time"))))
+ ||
+ (g_cts && !stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, CTS_RECORD, "time"))))
+ )
+ {
+ if(mod(i, 2)) { col = "^4*"; }
+ else { col = "^5*"; }
+ }
+ else
+ {
+ if(mod(i, 2)) { col = "^2"; }
+ else { col = "^3"; }
+ }
+
+ lsmaps = sprintf("%s%s%s ", lsmaps, col, MapInfo_Map_bspname);
+ }
+ }
+
+ MapInfo_ClearTemps();
+ return sprintf("^7Maps available: %s\n", lsmaps);
+}