Raised This Month: $51 Target: $400
 12% 

Having a Little problem with calculations


Post New Thread Reply   
 
Thread Tools Display Modes
katna
Senior Member
Join Date: May 2010
Old 09-01-2011 , 16:08   Re: Having a Little problem with calculations
Reply With Quote #11

Quote:
Originally Posted by Exolent[jNr] View Post


PHP Code:
while(player_experience[id] >= ((player_level[id] + 1) * 70)) 
Also, it's not infinite level if you set a max_level.
Level 0 : (0 + 1) * 70 = 80
Level 2 : (1 + 1) * 70 = 140
Level 3 : (2 + 1) * 70 = 210
And he wanted his code to be 280xp for the 3rd level.
PHP Code:
while(player_experience[id] >= ( min(70player_level[id] * 70 2) ) ) 
katna is offline
Krle
Senior Member
Join Date: Jul 2011
Location: Serbia, Nis
Old 09-01-2011 , 16:09   Re: Having a Little problem with calculations
Reply With Quote #12

Thats why i used "* 2" thing
__________________

Sorry about my BAD English
Krle is offline
Send a message via MSN to Krle
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 09-01-2011 , 16:18   Re: Having a Little problem with calculations
Reply With Quote #13

Quote:
Originally Posted by katna View Post
Level 0 : (0 + 1) * 70 = 80
Level 2 : (1 + 1) * 70 = 140
Level 3 : (2 + 1) * 70 = 210
And he wanted his code to be 280xp for the 3rd level.
PHP Code:
while(player_experience[id] >= ( min(70player_level[id] * 70 2) ) ) 
I think you need some better math skills.

Level 0: (0 + 1) * 70 = 1 * 70 = 70
Level 1: (1 + 1) * 70 = 2 * 70 = 140
Level 2: (2 + 1) * 70 = 3 * 70 = 210
Level 3: (3 + 1) * 70 = 4 * 70 = 280
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
katna
Senior Member
Join Date: May 2010
Old 09-01-2011 , 16:21   Re: Having a Little problem with calculations
Reply With Quote #14

Quote:
Originally Posted by nikhilgupta345 View Post
I think you need some better math skills.

Level 0: (0 + 1) * 70 = 1 * 70 = 70
Level 1: (1 + 1) * 70 = 2 * 70 = 140
Level 2: (2 + 1) * 70 = 3 * 70 = 210
Level 3: (3 + 1) * 70 = 4 * 70 = 280
how does i need better math skills, if you talk about the 80 it was just a typo.
anyway he DOESN'T want a level with 210 exp needed.
katna is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 09-01-2011 , 16:29   Re: Having a Little problem with calculations
Reply With Quote #15

This will do what he wants then:

PHP Code:
while(player_experience[id] >= ( 70 power2player_level[id] - ) ) ) 

Quote:
Originally Posted by katna
PHP Code:
while(player_experience[id] >= ( min(70player_level[id] * 70 2) ) ) 
For yours:
Level 0: 0 * 70 * 2 = 0. Min of 0 and 70 = 0.
Level 1: 1 * 70 * 2 = 140
Level 2: 2 * 70 * 2 = 280
Level 3: 3 * 70 * 2 = 420

0 and 420 doesn't work there.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please

Last edited by nikhilgupta345; 09-01-2011 at 16:43.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Krle
Senior Member
Join Date: Jul 2011
Location: Serbia, Nis
Old 09-01-2011 , 16:33   Re: Having a Little problem with calculations
Reply With Quote #16

while(player_experience[id] >= ((player_level[id] * 2) * 70))

Then whats wrong with this 1
__________________

Sorry about my BAD English
Krle is offline
Send a message via MSN to Krle
katna
Senior Member
Join Date: May 2010
Old 09-01-2011 , 16:33   Re: Having a Little problem with calculations
Reply With Quote #17

Quote:
Originally Posted by nikhilgupta345 View Post
This will do what he wants then:

PHP Code:
while(player_experience[id] >= ( 70 power2player_level[id] - ) ) ) 
level 0; ( -1 ^ 2 ) * 70 = 70
level 1; ( 0 ^ 2 ) * 70 = 0
level 2; No point to continue

Quote:
Originally Posted by Krle View Post
while(player_experience[id] >= ((player_level[id] * 2) * 70))

Then whats wrong with this 1
at level 0: 0 * 2 * 70 = 0
katna is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-01-2011 , 16:34   Re: Having a Little problem with calculations
Reply With Quote #18

Quote:
Originally Posted by katna View Post
level 0; ( -1 ^ 2 ) * 70 = 70
level 1; ( 0 ^ 2 ) * 70 = 0
level 2; No point to continue



at level 0: 0 * 2 * 70 = 0
Do you not know how to read code?
power(x,y) = x^y
Therefore, it would be 2^-1, 2^0, etc.
Yes, there was 1 little mistake (which I pointed out below), but other than that he is correct.

Quote:
Originally Posted by nikhilgupta345 View Post
This will do what he wants then:

PHP Code:
while(player_experience[id] >= ( 70 power2player_level[id] - ) ) ) 



For yours:
Level 1: 1 * 70 * 2 = 140
Level 2: 2 * 70 * 2 = 280
Level 3: 3 * 70 * 2 = 420

420 doesn't work there.
Remove the "-1" and it will be correct.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
katna
Senior Member
Join Date: May 2010
Old 09-01-2011 , 16:36   Re: Having a Little problem with calculations
Reply With Quote #19

Quote:
Originally Posted by Exolent[jNr] View Post
Remove the "-1" and it will be correct.
how does removing the -1 works? i'm confused... i'm pretty sure ( 0 ^ 2 ) * 70 equals 0
katna is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-01-2011 , 16:37   Re: Having a Little problem with calculations
Reply With Quote #20

Quote:
Originally Posted by katna View Post
how does removing the -1 works? i'm confused... i'm pretty sure ( 0 ^ 2 ) * 70 equals 0
You probably posted during my edit.
Re-read my post which was directed to you.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



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:23.


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