Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts

    Checking every 250 points in an if statement

    So I want something where if they have 250 points they can level up, at 500 points they level again, then again at 750.

    Would this work?

    PHP Code:
    $levelup $row['level'] * 250;

    if (
    $levelup == TRUE)
    {
    //Process level up

    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?

  • #2
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    PHP Code:
    $level floor$points 250 ); 
    < 250: level 0
    >= 250: level 1
    >= 500: level 2
    >= 750: level 3, etc...
    Last edited by kbluhm; 06-05-2009 at 10:47 PM.

  • #3
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    So you mean like this?

    PHP Code:
    $points $row['points'];
    $level floor($points 250 );

    if (
    $level >= 250)
    {
    //Process
    }
    else {
    //Add Points

    By the way I plan to reset their points to 0 on every level up.
    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •