mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-06 18:08:26 +00:00
Compare commits
1 Commits
964f19d529
...
aa196b2680
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa196b2680 |
@ -2301,7 +2301,7 @@ public int Native_SetPracticeMode(Handle handler, int numParams)
|
|||||||
bool practice = view_as<bool>(GetNativeCell(2));
|
bool practice = view_as<bool>(GetNativeCell(2));
|
||||||
bool alert = view_as<bool>(GetNativeCell(3));
|
bool alert = view_as<bool>(GetNativeCell(3));
|
||||||
|
|
||||||
if(alert && practice && !gA_Timers[client].bPracticeMode && (!gB_HUD || (Shavit_GetHUDSettings(client) & HUD_NOPRACALERT) == 0) && !Shavit_InsideZone(client, Zone_Start, -1))
|
if(alert && practice && !gA_Timers[client].bPracticeMode && (!gB_HUD || (Shavit_GetHUDSettings(client) & HUD_NOPRACALERT) == 0))
|
||||||
{
|
{
|
||||||
Shavit_PrintToChat(client, "%T", "PracticeModeAlert", client, gS_ChatStrings.sWarning, gS_ChatStrings.sText);
|
Shavit_PrintToChat(client, "%T", "PracticeModeAlert", client, gS_ChatStrings.sWarning, gS_ChatStrings.sText);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -631,11 +631,9 @@ public Action Command_SetTier(int client, int args)
|
|||||||
|
|
||||||
int tier = StringToInt(sArg);
|
int tier = StringToInt(sArg);
|
||||||
|
|
||||||
int maxtier = GetMaxTier();
|
if(args == 0 || tier < 1 || tier > 10)
|
||||||
|
|
||||||
if(args == 0 || tier < 1 || tier > maxtier)
|
|
||||||
{
|
{
|
||||||
ReplyToCommand(client, "%T", "ArgumentsMissing", client, "sm_settier <tier> (1-%d) [map]", maxtier);
|
ReplyToCommand(client, "%T", "ArgumentsMissing", client, "sm_settier <tier> (1-10) [map]");
|
||||||
|
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
@ -1724,10 +1722,3 @@ public void SQL_DeleteMap_Callback(Database db, DBResultSet results, const char[
|
|||||||
UpdateAllPoints(true);
|
UpdateAllPoints(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetMaxTier()
|
|
||||||
{
|
|
||||||
float val = 10.0;
|
|
||||||
gCV_DefaultTier.GetBounds(ConVarBound_Upper, val);
|
|
||||||
return RoundToFloor(val);
|
|
||||||
}
|
|
||||||
|
|||||||
@ -56,7 +56,6 @@ int gI_MapType[MAXPLAYERS+1];
|
|||||||
int gI_Style[MAXPLAYERS+1];
|
int gI_Style[MAXPLAYERS+1];
|
||||||
int gI_MenuPos[MAXPLAYERS+1];
|
int gI_MenuPos[MAXPLAYERS+1];
|
||||||
int gI_Track[MAXPLAYERS+1];
|
int gI_Track[MAXPLAYERS+1];
|
||||||
int gI_Tier[MAXPLAYERS+1];
|
|
||||||
int gI_TargetSteamID[MAXPLAYERS+1];
|
int gI_TargetSteamID[MAXPLAYERS+1];
|
||||||
char gS_TargetName[MAXPLAYERS+1][MAX_NAME_LENGTH];
|
char gS_TargetName[MAXPLAYERS+1][MAX_NAME_LENGTH];
|
||||||
|
|
||||||
@ -751,49 +750,12 @@ public int MenuHandler_MapsDoneLeft(Menu menu, MenuAction action, int param1, in
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int MenuHandler_MapsDoneLeft_Track(Menu menu, MenuAction action, int param1, int param2)
|
public int MenuHandler_MapsDoneLeft_Track(Menu menu, MenuAction action, int param1, int param2)
|
||||||
{
|
|
||||||
if(action == MenuAction_Select)
|
|
||||||
{
|
|
||||||
char sInfo[8], sTier[16];
|
|
||||||
menu.GetItem(param2, sInfo, 8);
|
|
||||||
gI_Track[param1] = StringToInt(sInfo);
|
|
||||||
|
|
||||||
if(gB_Rankings)
|
|
||||||
{
|
|
||||||
Menu submenu = new Menu(MenuHandler_MapsDoneLeft_Tier);
|
|
||||||
submenu.SetTitle("%T\n ", "SelectTier", param1);
|
|
||||||
|
|
||||||
submenu.AddItem("0", "All");
|
|
||||||
|
|
||||||
for(int i = 1; i <= 10; ++i)
|
|
||||||
{
|
|
||||||
IntToString(i, sInfo, 8);
|
|
||||||
FormatEx(sTier, 16, "Tier %d", i);
|
|
||||||
submenu.AddItem(sInfo, sTier);
|
|
||||||
}
|
|
||||||
|
|
||||||
submenu.Display(param1, MENU_TIME_FOREVER);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ShowMaps(param1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(action == MenuAction_End)
|
|
||||||
{
|
|
||||||
delete menu;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int MenuHandler_MapsDoneLeft_Tier(Menu menu, MenuAction action, int param1, int param2)
|
|
||||||
{
|
{
|
||||||
if(action == MenuAction_Select)
|
if(action == MenuAction_Select)
|
||||||
{
|
{
|
||||||
char sInfo[8];
|
char sInfo[8];
|
||||||
menu.GetItem(param2, sInfo, 8);
|
menu.GetItem(param2, sInfo, 8);
|
||||||
gI_Tier[param1] = StringToInt(sInfo);
|
gI_Track[param1] = StringToInt(sInfo);
|
||||||
|
|
||||||
ShowMaps(param1);
|
ShowMaps(param1);
|
||||||
}
|
}
|
||||||
@ -1218,7 +1180,7 @@ public int MenuHandler_TypeHandler(Menu menu, MenuAction action, int param1, int
|
|||||||
{
|
{
|
||||||
if(action == MenuAction_Select)
|
if(action == MenuAction_Select)
|
||||||
{
|
{
|
||||||
char sInfo[32], sTier[16];
|
char sInfo[32];
|
||||||
menu.GetItem(param2, sInfo, 32);
|
menu.GetItem(param2, sInfo, 32);
|
||||||
|
|
||||||
char sExploded[2][4];
|
char sExploded[2][4];
|
||||||
@ -1227,26 +1189,7 @@ public int MenuHandler_TypeHandler(Menu menu, MenuAction action, int param1, int
|
|||||||
gI_Track[param1] = StringToInt(sExploded[0]);
|
gI_Track[param1] = StringToInt(sExploded[0]);
|
||||||
gI_MapType[param1] = StringToInt(sExploded[1]);
|
gI_MapType[param1] = StringToInt(sExploded[1]);
|
||||||
|
|
||||||
if(gB_Rankings)
|
ShowMaps(param1);
|
||||||
{
|
|
||||||
Menu submenu = new Menu(MenuHandler_MapsDoneLeft_Tier);
|
|
||||||
submenu.SetTitle("%T\n ", "SelectTier", param1);
|
|
||||||
|
|
||||||
submenu.AddItem("0", "All");
|
|
||||||
|
|
||||||
for(int i = 1; i <= 10; ++i)
|
|
||||||
{
|
|
||||||
IntToString(i, sInfo, 8);
|
|
||||||
FormatEx(sTier, 16, "Tier %d", i);
|
|
||||||
submenu.AddItem(sInfo, sTier);
|
|
||||||
}
|
|
||||||
|
|
||||||
submenu.Display(param1, MENU_TIME_FOREVER);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ShowMaps(param1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if(action == MenuAction_Cancel && param2 == MenuCancel_ExitBack)
|
else if(action == MenuAction_Cancel && param2 == MenuCancel_ExitBack)
|
||||||
{
|
{
|
||||||
@ -1267,39 +1210,21 @@ void ShowMaps(int client)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
char sQuery[512], tierStr[32];
|
char sQuery[512];
|
||||||
|
|
||||||
if(gI_Tier[client] > 0)
|
|
||||||
{
|
|
||||||
FormatEx(tierStr, 32, " AND t.tier = %d", gI_Tier[client]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gI_Tier[client] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(gI_MapType[client] == MAPSDONE)
|
if(gI_MapType[client] == MAPSDONE)
|
||||||
{
|
{
|
||||||
if(gB_Rankings)
|
FormatEx(sQuery, 512,
|
||||||
{
|
"SELECT a.map, a.time, a.jumps, a.id, COUNT(b.map) + 1 as 'rank', a.points FROM %splayertimes a LEFT JOIN %splayertimes b ON a.time > b.time AND a.map = b.map AND a.style = b.style AND a.track = b.track WHERE a.auth = %d AND a.style = %d AND a.track = %d GROUP BY a.map, a.time, a.jumps, a.id, a.points ORDER BY a.%s;",
|
||||||
FormatEx(sQuery, 512,
|
gS_MySQLPrefix, gS_MySQLPrefix, gI_TargetSteamID[client], gI_Style[client], gI_Track[client], (gB_Rankings)? "points DESC":"map");
|
||||||
"SELECT a.map, a.time, a.jumps, a.id, COUNT(b.map) + 1 as 'rank', a.points FROM %splayertimes a LEFT JOIN %splayertimes b ON a.time > b.time AND a.map = b.map AND a.style = b.style AND a.track = b.track LEFT JOIN %smaptiers t ON a.map = t.map WHERE a.auth = %d AND a.style = %d AND a.track = %d%s GROUP BY a.map, a.time, a.jumps, a.id, a.points ORDER BY a.points DESC;",
|
|
||||||
gS_MySQLPrefix, gS_MySQLPrefix, gS_MySQLPrefix, gI_TargetSteamID[client], gI_Style[client], gI_Track[client], tierStr);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FormatEx(sQuery, 512,
|
|
||||||
"SELECT a.map, a.time, a.jumps, a.id, COUNT(b.map) + 1 as 'rank', a.points FROM %splayertimes a LEFT JOIN %splayertimes b ON a.time > b.time AND a.map = b.map AND a.style = b.style AND a.track = b.track WHERE a.auth = %d AND a.style = %d AND a.track = %d GROUP BY a.map, a.time, a.jumps, a.id, a.points ORDER BY a.map;",
|
|
||||||
gS_MySQLPrefix, gS_MySQLPrefix, gI_TargetSteamID[client], gI_Style[client], gI_Track[client]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(gB_Rankings)
|
if(gB_Rankings)
|
||||||
{
|
{
|
||||||
FormatEx(sQuery, 512,
|
FormatEx(sQuery, 512,
|
||||||
"SELECT DISTINCT m.map, t.tier FROM %smapzones m LEFT JOIN %smaptiers t ON m.map = t.map WHERE m.type = 0 AND m.track = %d%s AND m.map NOT IN (SELECT DISTINCT map FROM %splayertimes WHERE auth = %d AND style = %d AND track = %d) ORDER BY m.map;",
|
"SELECT DISTINCT m.map, t.tier FROM %smapzones m LEFT JOIN %smaptiers t ON m.map = t.map WHERE m.type = 0 AND m.track = %d AND m.map NOT IN (SELECT DISTINCT map FROM %splayertimes WHERE auth = %d AND style = %d AND track = %d) ORDER BY m.map;",
|
||||||
gS_MySQLPrefix, gS_MySQLPrefix, gI_Track[client], tierStr, gS_MySQLPrefix, gI_TargetSteamID[client], gI_Style[client], gI_Track[client]);
|
gS_MySQLPrefix, gS_MySQLPrefix, gI_Track[client], gS_MySQLPrefix, gI_TargetSteamID[client], gI_Style[client], gI_Track[client]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1403,19 +1328,13 @@ public void ShowMapsCallback(Database db, DBResultSet results, const char[] erro
|
|||||||
menu.AddItem(sRecordID, sDisplay);
|
menu.AddItem(sRecordID, sDisplay);
|
||||||
}
|
}
|
||||||
|
|
||||||
char sTier[8];
|
|
||||||
if(gI_Tier[client] > 0)
|
|
||||||
{
|
|
||||||
FormatEx(sTier, 8, "T%d ", gI_Tier[client]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(gI_MapType[client] == MAPSDONE)
|
if(gI_MapType[client] == MAPSDONE)
|
||||||
{
|
{
|
||||||
menu.SetTitle("%s%T (%s)", sTier, "MapsDoneFor", client, gS_StyleStrings[gI_Style[client]].sShortName, gS_TargetName[client], rows, sTrack);
|
menu.SetTitle("%T (%s)", "MapsDoneFor", client, gS_StyleStrings[gI_Style[client]].sShortName, gS_TargetName[client], rows, sTrack);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
menu.SetTitle("%s%T (%s)", sTier, "MapsLeftFor", client, gS_StyleStrings[gI_Style[client]].sShortName, gS_TargetName[client], rows, sTrack);
|
menu.SetTitle("%T (%s)", "MapsLeftFor", client, gS_StyleStrings[gI_Style[client]].sShortName, gS_TargetName[client], rows, sTrack);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(menu.ItemCount == 0)
|
if(menu.ItemCount == 0)
|
||||||
|
|||||||
@ -16,10 +16,6 @@
|
|||||||
{
|
{
|
||||||
"en" "Select timer track:"
|
"en" "Select timer track:"
|
||||||
}
|
}
|
||||||
"SelectTier"
|
|
||||||
{
|
|
||||||
"en" "Select map tier:"
|
|
||||||
}
|
|
||||||
"MapsDone"
|
"MapsDone"
|
||||||
{
|
{
|
||||||
"en" "Maps done"
|
"en" "Maps done"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user