bladewolf2010 Posted May 31, 2010 Share Posted May 31, 2010 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 Quote Link to comment Share on other sites More sharing options...
Danny696 Posted May 31, 2010 Share Posted May 31, 2010 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; } Quote Link to comment Share on other sites More sharing options...
bladewolf2010 Posted May 31, 2010 Author Share Posted May 31, 2010 How do i make it so ppl can see there rank? Quote Link to comment Share on other sites More sharing options...
Danny696 Posted May 31, 2010 Share Posted May 31, 2010 Which rank? Quote Link to comment Share on other sites More sharing options...
bladewolf2010 Posted May 31, 2010 Author Share Posted May 31, 2010 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"; } Quote Link to comment Share on other sites More sharing options...
AlabamaHit Posted May 31, 2010 Share Posted May 31, 2010 echo $tp; Check out this website :) might help With some of the smaller stuff like this anyways. Quote Link to comment Share on other sites More sharing options...
Danny696 Posted May 31, 2010 Share Posted May 31, 2010 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"; } } Quote Link to comment Share on other sites More sharing options...
Djkanna Posted June 1, 2010 Share Posted June 1, 2010 Undefined Variable "housevalue" Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted June 1, 2010 Share Posted June 1, 2010 Good point DJK Quote Link to comment Share on other sites More sharing options...
Djkanna Posted June 1, 2010 Share Posted June 1, 2010 :P Moved to Modification Support Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.