Jump to content
MakeWebGames

error :/


Recommended Posts

this is in global_func

 

function  get_gamerank($level, $stats)
{
$tp=($level*$level) *  3000 + ($housevalue) +  (($stats['strength']+$stats['agility']+$stats['guard']+$stats['labour']+$stats['IQ'])  * 10);
if ( $tp < 5000 ) { return "#1 First Newbie"; }
else  if ( $tp < 10000 ) { return "#2 Newbie"; }
else if ( $tp <  20000 ) { return "#3 Beginner"; }
else if ( $tp < 40000 ) {  return "#4 Not Experienced"; }
else if ( $tp < 80000 ) { return  "#5 Rookie"; }
else if ( $tp < 160000 ) { return "#6 Average";  }
else if ( $tp < 320000 ) { return "#7 Good"; }
else if (  $tp < 640000 ) { return "#8 Very Good"; }
else if ( $tp <  1280000 ) { return "#9 Greater Than Average"; }
else if ( $tp <  2360000 ) { return "#10 Experienced"; }
else if ( $tp <  4720000 ) { return "#11 Highly Experienced"; }
else if ( $tp <  9440000 ) { return "#12 Honoured"; }
else if ( $tp <  18880000 ) { return "#13 Highly Hounoured"; }
else if ( $tp <  39960000 ) { return "#14 Respect King"; }
else if ( $tp <  79812000 ) { return "#15 True Champion"; }
}
{
global $db;
global $ir,$userid,$c;
$q=$db->query("SELECT count(*) FROM userstats us LEFT JOIN users u ON us.userid=u.userid WHERE us.$mykey > $stat AND us.userid != $userid AND u.user_level != 0") ;
return $db->fetch_single($q)+1;
}

 

 

error is

Fatal error:  Call to a member function query() on a non-object  in /home/rainofhe/public_html/global_func.php on line 332
Link to comment
Share on other sites

Your returning two things here ;/ and if the function was to work it would be

function  get_gamerank($level, $stats)
{
$tp=($level*$level) *  3000 + ($housevalue) +  (($stats['strength']+$stats['agility']+$stats['guard']+$stats['labour']+$stats['IQ'])  * 10);
if ( $tp < 5000 ) { return "#1 First Newbie"; }
else  if ( $tp < 10000 ) { return "#2 Newbie"; }
else if ( $tp <  20000 ) { return "#3 Beginner"; }
else if ( $tp < 40000 ) {  return "#4 Not Experienced"; }
else if ( $tp < 80000 ) { return  "#5 Rookie"; }
else if ( $tp < 160000 ) { return "#6 Average";  }
else if ( $tp < 320000 ) { return "#7 Good"; }
else if (  $tp < 640000 ) { return "#8 Very Good"; }
else if ( $tp <  1280000 ) { return "#9 Greater Than Average"; }
else if ( $tp <  2360000 ) { return "#10 Experienced"; }
else if ( $tp <  4720000 ) { return "#11 Highly Experienced"; }
else if ( $tp <  9440000 ) { return "#12 Honoured"; }
else if ( $tp <  18880000 ) { return "#13 Highly Hounoured"; }
else if ( $tp <  39960000 ) { return "#14 Respect King"; }
else if ( $tp <  79812000 ) { return "#15 True Champion"; }
global $db, $userid;
$q=$db->query("SELECT count(*) FROM userstats us LEFT JOIN users u ON us.userid=u.userid WHERE us.$mykey > $stat AND us.userid != $userid AND u.user_level != 0") ;
return $db->fetch_single($q)+1;
}
Link to comment
Share on other sites

the #'s

 

 

if ( $tp < 5000 ) { return "#1 First Newbie"; }
else  if ( $tp < 10000 ) { return "#2 Newbie"; }
else if ( $tp <  20000 ) { return "#3 Beginner"; }
else if ( $tp < 40000 ) {  return "#4 Not Experienced"; }
else if ( $tp < 80000 ) { return  "#5 Rookie"; }
else if ( $tp < 160000 ) { return "#6 Average";  }
else if ( $tp < 320000 ) { return "#7 Good"; }
else if (  $tp < 640000 ) { return "#8 Very Good"; }
else if ( $tp <  1280000 ) { return "#9 Greater Than Average"; }
else if ( $tp <  2360000 ) { return "#10 Experienced"; }
else if ( $tp <  4720000 ) { return "#11 Highly Experienced"; }
else if ( $tp <  9440000 ) { return "#12 Honoured"; }
else if ( $tp <  18880000 ) { return "#13 Highly Hounoured"; }
else if ( $tp <  39960000 ) { return "#14 Respect King"; }
else if ( $tp <  79812000 ) { return "#15 True Champion"; }

Link to comment
Share on other sites

function  get_gamerank($level, $stats)
{
$tp=($level*$level) *  3000 + ($housevalue) +  (($stats['strength']+$stats['agility']+$stats['guard']+$stats['labour']+$stats['IQ'])  * 10);
if ( $tp < 5000 ) { return "#1 First Newbie"; }
else  if ( $tp < 10000 ) { return "#2 Newbie"; }
else if ( $tp <  20000 ) { return "#3 Beginner"; }
else if ( $tp < 40000 ) {  return "#4 Not Experienced"; }
else if ( $tp < 80000 ) { return  "#5 Rookie"; }
else if ( $tp < 160000 ) { return "#6 Average";  }
else if ( $tp < 320000 ) { return "#7 Good"; }
else if (  $tp < 640000 ) { return "#8 Very Good"; }
else if ( $tp <  1280000 ) { return "#9 Greater Than Average"; }
else if ( $tp <  2360000 ) { return "#10 Experienced"; }
else if ( $tp <  4720000 ) { return "#11 Highly Experienced"; }
else if ( $tp <  9440000 ) { return "#12 Honoured"; }
else if ( $tp <  18880000 ) { return "#13 Highly Hounoured"; }
else if ( $tp <  39960000 ) { return "#14 Respect King"; }
else if ( $tp <  79812000 ) { return "#15 True Champion"; }
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...