From d7b68afa01398c6b16633c4ceef9560543cd8f50 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Wed, 10 Oct 2018 20:15:21 +1100 Subject: [PATCH] allow players over level 100 to accrue more xp regardless --- gamemodes/irresistible/cnr/experience.pwn | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gamemodes/irresistible/cnr/experience.pwn b/gamemodes/irresistible/cnr/experience.pwn index 1599f52..34ff582 100644 --- a/gamemodes/irresistible/cnr/experience.pwn +++ b/gamemodes/irresistible/cnr/experience.pwn @@ -71,11 +71,16 @@ static stock ; /* ** Important ** */ -stock Float: GetPlayerLevel( playerid, E_LEVELS: level ) { - return floatsqroot( g_playerExperience[ playerid ] [ level ] / ( ( g_levelData[ _: level ] [ E_MAX_UNITS ] * g_levelData[ _: level ] [ E_XP_DILATION ] ) / ( EXP_MAX_PLAYER_LEVEL * EXP_MAX_PLAYER_LEVEL ) ) ); +stock Float: GetPlayerLevel( playerid, E_LEVELS: level ) +{ + new + Float: player_level = floatsqroot( g_playerExperience[ playerid ] [ level ] / ( ( g_levelData[ _: level ] [ E_MAX_UNITS ] * g_levelData[ _: level ] [ E_XP_DILATION ] ) / ( EXP_MAX_PLAYER_LEVEL * EXP_MAX_PLAYER_LEVEL ) ) ); + + return player_level > 100.0 ? 100.0 : player_level; } -stock Float: GetPlayerTotalExperience( playerid ) { +stock Float: GetPlayerTotalExperience( playerid ) +{ new Float: experience = 0.0; @@ -227,7 +232,7 @@ stock GivePlayerExperience( playerid, E_LEVELS: level, Float: default_xp = 1.0, // check if its over 100 anyway if ( ( g_playerExperience[ playerid ] [ level ] += xp_earned ) > g_levelData[ _: level ] [ E_MAX_UNITS ] * g_levelData[ _: level ] [ E_XP_DILATION ] ) { - g_playerExperience[ playerid ] [ level ] = g_levelData[ _: level ] [ E_MAX_UNITS ] * g_levelData[ _: level ] [ E_XP_DILATION ]; + // g_playerExperience[ playerid ] [ level ] = g_levelData[ _: level ] [ E_MAX_UNITS ] * g_levelData[ _: level ] [ E_XP_DILATION ]; // stop player from accumulating more exp SetPlayerProgressBarValue( playerid, p_playerExpProgress[ playerid ], 100.0 ); } else { new Float: progress = floatfract( GetPlayerLevel( playerid, level ) ) * 100.0;