From dc48762943a04f1cdb9010979e20ca74c6d82e5e Mon Sep 17 00:00:00 2001 From: navewindre Date: Mon, 13 Nov 2023 15:15:03 +0100 Subject: remove block ljs, sv_enablebunnyhopping 0 stats, better restartgame fix --- sourcemod-1.5-dev/scripting/ljstats.sp | 61 ++++++---------------------- sourcemod/scripting/gem_halftime_teamswap.sp | 35 ++++------------ 2 files changed, 19 insertions(+), 77 deletions(-) diff --git a/sourcemod-1.5-dev/scripting/ljstats.sp b/sourcemod-1.5-dev/scripting/ljstats.sp index 48eadb5..250ba56 100644 --- a/sourcemod-1.5-dev/scripting/ljstats.sp +++ b/sourcemod-1.5-dev/scripting/ljstats.sp @@ -215,50 +215,42 @@ enum GAP_SELECTION_MODE enum LJTOP_TABLE { LT_LJ, - LT_BLOCKLJ, LT_SWLJ, LT_BWLJ, LT_CJ, LT_BJ, LT_LAJ, - LT_STRAFEBHOP, - LT_END, + LT_END } new String:g_strLJTopTags[LT_END][] = { "lj", - "blj", "swlj", "bwlj", "cj", "bj", - "laj", - "strafebhop" + "laj" }; new String:g_strLJTopTableName[LT_END][] = { "Longjump", - "Block longjump", "Sideways longjump", "Backwards longjump", "Countjump", "Bhopjump", - "Ladderjump", - "Multibhop" + "Ladderjump" }; new String:g_strLJTopOutput[LT_END][] = { "lj", - "block lj", "sideways lj", "backwards lj", "countjump", "bhopjump", - "ladderjump", - "multibhop" + "ladderjump" }; new String:g_strJumpType[JT_END][] = @@ -1558,18 +1550,10 @@ LJTopCreateMenu(LJTOP_TABLE:nTable) break; } - if(nTable == LT_BLOCKLJ) - { - FormatEx(buf, sizeof(buf), "%s - %.2f (%.2f: %.2f, %d @ %d%%, %.2f)", - g_LJTop[LT_BLOCKLJ][i][m_strName], g_LJTop[LT_BLOCKLJ][i][m_fBlockDistance], g_LJTop[LT_BLOCKLJ][i][m_fDistance], - g_LJTop[LT_BLOCKLJ][i][m_fPrestrafe], g_LJTop[LT_BLOCKLJ][i][m_nStrafes], RoundFloat(g_LJTop[LT_BLOCKLJ][i][m_fSync]), g_LJTop[LT_BLOCKLJ][i][m_fMaxSpeed]); - } - else - { - FormatEx(buf, sizeof(buf), "%s - %.2f (%.2f, %d @ %d%%, %.2f)", - g_LJTop[nTable][i][m_strName], g_LJTop[nTable][i][m_fDistance], - g_LJTop[nTable][i][m_fPrestrafe], g_LJTop[nTable][i][m_nStrafes], RoundFloat(g_LJTop[nTable][i][m_fSync]), g_LJTop[nTable][i][m_fMaxSpeed]); - } + + FormatEx(buf, sizeof(buf), "%s - %.2f (%.2f, %d @ %d%%, %.2f)", + g_LJTop[nTable][i][m_strName], g_LJTop[nTable][i][m_fDistance], + g_LJTop[nTable][i][m_fPrestrafe], g_LJTop[nTable][i][m_nStrafes], RoundFloat(g_LJTop[nTable][i][m_fSync]), g_LJTop[nTable][i][m_fMaxSpeed]); FormatEx(info, sizeof(info), "%s;%d", g_strLJTopTags[nTable], i); @@ -2048,10 +2032,6 @@ LJTopUpdate(client) { LJTopUpdateTable(client, LT_LJ); } - if(g_PlayerStates[client][bBlockMode] && !g_PlayerStates[client][bFailedBlock] && g_PlayerStates[client][fBlockDistance] > g_LJTop[LT_BLOCKLJ][LJTOP_NUM_ENTRIES - 1][m_fBlockDistance]) - { - LJTopUpdateTable(client, LT_BLOCKLJ); - } if(g_PlayerStates[client][JumpDir] == JD_SIDEWAYS && g_PlayerStates[client][fJumpDistance] > g_LJTop[LT_SWLJ][LJTOP_NUM_ENTRIES - 1][m_fDistance]) { LJTopUpdateTable(client, LT_SWLJ); @@ -2073,10 +2053,6 @@ LJTopUpdate(client) { LJTopUpdateTable(client, LT_LAJ); } - else if(g_PlayerStates[client][JumpType] == JT_BHOP && !g_bEnableBunnyHopping && g_PlayerStates[client][fJumpDistance] > g_LJTop[LT_STRAFEBHOP][LJTOP_NUM_ENTRIES - 1][m_fDistance]) - { - LJTopUpdateTable(client, LT_STRAFEBHOP); - } } LJTopUpdateTable(client, LJTOP_TABLE:nLJTopTable) @@ -2093,11 +2069,7 @@ LJTopUpdateTable(client, LJTOP_TABLE:nLJTopTable) new nPos = 0; - while(nPos < 9 && - (nLJTopTable == LT_BLOCKLJ ? g_PlayerStates[client][fBlockDistance] < g_LJTop[nLJTopTable][nPos][m_fBlockDistance] || - (g_PlayerStates[client][fBlockDistance] == g_LJTop[nLJTopTable][nPos][m_fBlockDistance] && - g_PlayerStates[client][fJumpDistance] < g_LJTop[nLJTopTable][nPos][m_fDistance]) : - g_PlayerStates[client][fJumpDistance] < g_LJTop[nLJTopTable][nPos][m_fDistance])) // longest statement in history + while(nPos < 9 && g_PlayerStates[client][fJumpDistance] < g_LJTop[nLJTopTable][nPos][m_fDistance]) // longest statement in history { if(!strcmp(g_LJTop[nLJTopTable][nPos][m_strSteamID], strSteamID)) { @@ -2122,8 +2094,7 @@ LJTopUpdateTable(client, LJTOP_TABLE:nLJTopTable) new bool:bSilent; - if(/*g_LJTop[nLJTopTable][nPos][m_strSteamID][0] == 0 || */g_PlayerStates[client][fJumpDistance] < g_fLJMin || - (nLJTopTable == LT_BLOCKLJ && nOldPos == nPos && g_PlayerStates[client][fBlockDistance] == g_LJTop[nLJTopTable][nPos][m_fBlockDistance])) + if(g_PlayerStates[client][fJumpDistance] < g_fLJMin) { bSilent = true; } @@ -2189,16 +2160,8 @@ LJTopUpdateTable(client, LJTOP_TABLE:nLJTopTable) return; } - if(nLJTopTable == LT_BLOCKLJ) - { - CPrintToChatAll("%s {green}%s top {default}%d{green} in block lj top with {default}%.2f{green} longjump at {default}%.1f{green} block!", - strName, nPos == nOldPos ? "has improved their" : "is now", nPos + 1, g_PlayerStates[client][fJumpDistance], g_PlayerStates[client][fBlockDistance]); - } - else - { - CPrintToChatAll("%s {green}%s top {default}%d{green} in %s top with {default}%.2f{green} %s!", - strName, nPos == nOldPos ? "has improved their" : "is now", nPos + 1, g_strLJTopOutput[nLJTopTable], g_PlayerStates[client][fJumpDistance], g_strJumpTypeLwr[g_PlayerStates[client][JumpType]]); - } + CPrintToChatAll("%s {green}%s top {default}%d{green} in %s top with {default}%.2f{green} %s!", + strName, nPos == nOldPos ? "has improved their" : "is now", nPos + 1, g_strLJTopOutput[nLJTopTable], g_PlayerStates[client][fJumpDistance], g_strJumpTypeLwr[g_PlayerStates[client][JumpType]]); } public Native_CancelJump(Handle:hPlugin, nParams) diff --git a/sourcemod/scripting/gem_halftime_teamswap.sp b/sourcemod/scripting/gem_halftime_teamswap.sp index bed6959..9fdc3b3 100644 --- a/sourcemod/scripting/gem_halftime_teamswap.sp +++ b/sourcemod/scripting/gem_halftime_teamswap.sp @@ -68,7 +68,6 @@ public OnPluginStart(){ CreateConVar("sm_halftime_teamswitch_version", PLUGIN_VERSION, "Halftime teamswitch version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY); HookEvent("round_start", Event_RoundStart); HookEvent("round_end", Event_RoundEnd); - HookEvent("restart_round_(1_second)", Event_RestartRound ); g_h_moneyReset = CreateConVar("sm_halftime_money_reset", "1", "If weapons should be removed and money reset to mp_startmoney"); g_h_mp_startmoney = FindConVar("mp_startmoney"); @@ -85,17 +84,6 @@ public OnPluginStart(){ } -public Event_RestartRound( Handle: event, const String:name[], bool dontBroadcast ) { - g_CtScore = 0; - g_TScore = 0; - - g_halftime_do_resetMoney = true; - g_roundCount = 0; - - SetTeamScore(CS_TEAM_CT, g_CtScore); - SetTeamScore(CS_TEAM_T, g_TScore); -} - // RoundStart gets the maptime // Checks to see if halftime has passed, if not then make sure halftime is 0 // Setting halftime false here as well since in some occasions when extending map @@ -105,12 +93,14 @@ public Event_RoundStart (Handle:event, const String:name[], bool:dontBroadcast) new wepIdx; new playerTeam; - g_roundCount++; - //LogMessage(">>> Increasing roundCount %d<<<", g_roundCount); - GetMapTimeLimit(mapTime); mapTime=mapTime*60; + g_CtScore = GetTeamScore(CS_TEAM_CT); + g_TScore = GetTeamScore(CS_TEAM_T); + + g_roundCount = g_CtScore + g_TScore; + if (g_halftime_do_resetMoney) { for (new client=1; client<=GetMaxClients(); client++) { @@ -140,13 +130,11 @@ public Event_RoundStart (Handle:event, const String:name[], bool:dontBroadcast) g_halftime_do_resetMoney = false; } -// At Round end we check if time left of the map is passed halftime. -// If so and we have not already switched teams before, switch teams and then set halftime to 1 public Event_RoundEnd (Handle:event, const String:name[], bool:dontBroadcast) { new mapTimeLeft; new bool:doSwap = false; -// new CTScore, TScore; + new reason = GetEventInt(event, "reason"); new winner = GetEventInt(event, "winner"); @@ -196,13 +184,7 @@ public Event_RoundEnd (Handle:event, const String:name[], bool:dontBroadcast) Call_StartForward(g_f_on_ht); Call_Finish(); - //LogMessage(">>> Halftime, switching players to oposite team <<<"); - - //LogToGame(">>>>>Setting halftime to true<<<<<"); halftime = true; - - //Loop through all players and see if they are in game and that they are on a team - //LogMessage("Players to switch: %d", GetMaxClients()); for (new i=1; i<=GetMaxClients(); i++) { if (IsClientInGame (i) && IsClientConnected(i)) { @@ -233,10 +215,7 @@ public Event_RoundEnd (Handle:event, const String:name[], bool:dontBroadcast) //LogMessage("Player %d is *NOT* InGame", i); } } - //CTScore = GetTeamScore(CS_TEAM_CT); - //TScore = GetTeamScore(CS_TEAM_T); - //SetTeamScore(CS_TEAM_CT, TScore); - //SetTeamScore(CS_TEAM_T, CTScore); + new tmp; tmp = g_CtScore; g_CtScore = g_TScore; -- cgit v1.2.3