Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $spend = array("energy","awake");
- if (array_key_exists("spend",$_GET) && in_array($spend,$_GET))
- {
- if($user_class->points >= 10)
- {
- if($user_class->energy == $user_class->maxenergy)
- echo Message("Your energy is already full up!");
- else
- {
- $newpoints = $user_class->points - 10;
- echo Message("You Refilled Your Energy and Awake.");
- }
- }
- else
- echo Message("You don't have enough points to do that.");
- if ($user_class->awakepercent == 100)
- echo Message("Your awake is already full up!");
- elseif ($user_class->points == 0)
- echo Message("You don't have enough points to do that.");
- else
- {
- $points_to_use = $user_class->points;
- $points_to_use = floor(($points_to_use > (100 - $user_class->awakepercent)) ? (100 - $user_class->awakepercent) : $points_to_use);
- $awake_to_digits = floor($user_class->directmaxawake * ($points_to_use / 100));
- $newawake = floor($user_class->directawake + $awake_to_digits);
- $newawake = ($newawake > $user_class->directmaxawake) ? $user_class->directmaxawake : $newawake;
- $newpoints = $user_class->points - $points_to_use;
- $result = mysql_query("UPDATE `grpgusers` SET `energy` = '".$user_class->maxenergy."',`awake` = '".$newawake."', `points`='".$newpoints."' WHERE `id`='".$_SESSION['id']."'");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment