Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP
Author Message
Donovan
Client



Joined: Oct 07, 2003
Posts: 735
Location: Ohio

PostPosted: Mon Jan 15, 2007 7:52 pm Reply with quote

It is not behaving correctly.

Code:
function checkRPlevel($r_points, $team_id, $rp_id){

include_once("header.php");
global $db, $prefix;

//Total RP in lookup table.
$result = $db->sql_query ("SELECT SUM(r_points) as resourcepoints FROM ".$prefix . "_eto_rpoints_lkup WHERE team_id ='$team_id' AND rp_id = '4' OR rp_id = '5'");
$info = $db->sql_fetchrow($result);
$resourcepoints = $info[resourcepoints];

if ($resourcepoints == 0) {
OpenTable();
echo "This action is denied.</br>";
echo "Your unit has Zero Resource Points.</br>";
echo "Contact your division SAC and get resupplied with Resource Points.";
CloseTable();
exit();
   }elseif ($resourcepoints <= 2 && $resourcepoints > 0) {
   OpenTable();
echo "This action is denied.</br>";
echo "You do not have enough Resource Points for this action.</br>";
echo "Movement on the Battlefield requires a RP level greater than 2.</br>";
echo "Territory has not changed.";
CloseTable();
exit();
      }elseif ($resourcepoints <= 4 && $resourcepoints >= 3) {
   OpenTable();
echo "Action is Accepted.</br>";
echo "Your Unit is partially operational with a balance of $resourcepoints Resource Points.</br>";
echo "Any pending attack means you must play the next match 1 man down.";
CloseTable();
   }else{
OpenTable();
echo "Action is Accepted.</br>";
echo "Unit is considered Fully Operational with a Balance of $resourcepoints Resource Points.";
CloseTable();
}
}


I call it using this.

checkRPlevel($r_points, $team_id, $rp_id); //Check to see if they have enough RP
 
View user's profile Send private message Visit poster's website ICQ Number
Gremmie
Former Moderator in Good Standing



Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Mon Jan 15, 2007 8:52 pm Reply with quote

Well what did you expect it to do and what is it doing?

_________________
Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©