From d4cdec6f118ce27cc821c4f86a05bc6ef7c7c364 Mon Sep 17 00:00:00 2001 From: 9iky6 Date: Sat, 26 Jul 2014 21:13:49 +0600 Subject: [PATCH] Update statsx.sma --- plugins/cstrike/statsx.sma | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/plugins/cstrike/statsx.sma b/plugins/cstrike/statsx.sma index a48159f5..0873b3d7 100755 --- a/plugins/cstrike/statsx.sma +++ b/plugins/cstrike/statsx.sma @@ -314,18 +314,12 @@ public cmdHudTest(id) // Stats formulas Float:accuracy(izStats[8]) { - if (!izStats[STATS_SHOTS]) - return (0.0) - - return (100.0 * float(izStats[STATS_HITS]) / float(izStats[STATS_SHOTS])) + return izStats[STATS_SHOTS] ? (100.0 * float(izStats[STATS_HITS]) / float(izStats[STATS_SHOTS])) : (0.0); } Float:effec(izStats[8]) { - if (!izStats[STATS_KILLS]) - return (0.0) - - return (100.0 * float(izStats[STATS_KILLS]) / float(izStats[STATS_KILLS] + izStats[STATS_DEATHS])) + return izStats[STATS_KILLS] ? (100.0 * float(izStats[STATS_KILLS]) / float(izStats[STATS_KILLS] + izStats[STATS_DEATHS])) : (0.0); } // Distance formula (metric) @@ -349,15 +343,9 @@ set_plugin_mode(id, sFlags[]) // Get config parameters. get_config_cvars() { - g_fFreezeTime = get_pcvar_float(g_pFreezeTime) + g_fFreezeTime = max(get_pcvar_float(g_pFreezeTime), 0.0); - if (g_fFreezeTime < 0.0) - g_fFreezeTime = 0.0 - - g_fHUDDuration = get_pcvar_float(g_pHudDuration) - - if (g_fHUDDuration < 1.0) - g_fHUDDuration = 1.0 + g_fHUDDuration = max(get_pcvar_float(g_pHudDuration), 1.0); g_fFreezeLimitTime = get_pcvar_float(g_pHudFreezeLimit) }