Code:
new const g_iRequiredKillsPerLevel[ ] =
{
16,
32,
64,
128,
256
};
new g_iLevel[ 33 ], g_iKills[ 33 ], g_iRequiredKills[ 33 ];
g_iKills[ id ] = 37;
while( g_iKills[ id ] >= g_iRequiredKillsPerLevel[ g_iLevel[ id ] ] )
{
g_iLevel[ id ]++;
}
g_iRequiredKills[ id ] = g_iRequiredKillsPerLevel[ g_iLevel[ id ] + 1 ] - g_iKills[ id ];
// this would make the level increase, as 37 is higher than the first two values in the global variable g_iRequiredKillsPerLevel, and therefore making g_iLevel variable increase in the while() loop
// g_iRequiredKills holds the value that needs to be exceeded to gain another level
__________________