Raised This Month: $ Target: $400
 0% 

Required_kills_for_next_level


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-12-2010 , 10:26   Re: Required_kills_for_next_level
Reply With Quote #10

PHP Code:
new const g_iRequiredKillsPerLevel[ ] = 
{
    
16,
    
32,
    
64,
    
128,
    
256
};

new 
g_iLevel33 ]; //Players current level
new g_iKills33 ]; //Players current # kills 
new g_iRequiredKills33 ]; //# kills needed for next level

//Example current kill#
g_iKillsid ] = 37;

//Keep looping while the kills are >= each kill level (range from 16-256). With each
//iteration, g_iLevel increases by 1 to change the required kill level we are checking.
//This loop would exit on the 3rd condition check leaving vals at: 
// g_iKills=37, g_iLevel=1, g_iRequiredKillsPerLevel=32
while( g_iKillsid ] >= g_iRequiredKillsPerLevelg_iLevelid ] ] )
{
    
/*Iterations
    1. g_iKills=37, g_iLevel=0, g_iRequiredKillsPerLevel=16
    2. g_iKills=37, g_iLevel=1, g_iRequiredKillsPerLevel=32 (loop exits here since 37 < 64)
    3. g_iKills=37, g_iLevel=2, g_iRequiredKillsPerLevel=64  */
    
g_iLevelid ]++;
}

//Here we determine the # kills needed for next level with these values:
// g_iLevel[ id ] = 1
// g_iLevel[ id ] + 1 = 2
// g_iRequiredKillsPerLevel[ 2 ] = 64
// g_iKills[ id ] = 37

// 27 = 64 - 37
g_iRequiredKillsid ] = g_iRequiredKillsPerLevelg_iLevelid ] + ] - g_iKillsid ]; 
__________________
Bugsy is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode