Z?v?? Posted March 5, 2007 Posted March 5, 2007 I'm having a bit of trouble with 2 of my mods. I converted these to fit with my version. This is the error message i'm getting with my battletent: Fatal error: Call to a member function on a non-object in /home2/lifecom/public_html/battletent.php on line 19 Herre are lines from my battle tent: 17 - print " Battle Tent 18 - Welcome to the battle tent! Here you can challenge NPCs for money. 19 - Bot Name Level Times Owned Ready 21 - To Be Challenged? Location Money Won Challenge The other mod i'm having trouble with is my lucky boxes mod. I also converted this on to work with my game. This is the error message i'm getting with my lucky boxes mod: Fatal error: Call to a member function on a non-object in /home2/lifecom/public_html/lucky.php on line 31 Here are the lines from my lucky boxes mod: 31 - $number=rand(1, 5); 32 - $db->query("UPDATE users SET boxes_opened=boxes_opened+1, money=money- 33 - 1000 WHERE userid=$userid"); Any Help With Either of These Would Be Much Appreciated. :-) Quote
Cronus Posted March 5, 2007 Posted March 5, 2007 Re: Some Code Confusion??????? The other mod i'm having trouble with is my lucky boxes mod. I also converted this on to work with my game. This is the error message i'm getting with my lucky boxes mod: Fatal error: Call to a member function on a non-object in /home2/lifecom/public_html/lucky.php on line 31 Here are the lines from my lucky boxes mod: 31 - $number=rand(1, 5); 32 - $db->query("UPDATE users SET boxes_opened=boxes_opened+1, money=money- 33 - 1000 WHERE userid=$userid"); Use this: Here are the lines from my lucky boxes mod: 31 - $number=rand(1,5); 32 - $db->query("UPDATE users SET boxes_opened=boxes_opened+1, money=money- 33 - 1000 WHERE userid=$userid"); You had a space in your random number draw there between the , and the 5. That was your problem. Quote
Z?v?? Posted March 5, 2007 Author Posted March 5, 2007 Re: Some Code Confusion??????? I've tried it with and without the space but it gives me the same error message both times. Quote
Decepti0n Posted March 5, 2007 Posted March 5, 2007 Re: Some Code Confusion??????? $db isn't an object either you aren't including the right files, you didn't put $db = new Database; or whatever, or you're using stolen code or code that wont fit. for a quick fix just use mysql_query instead of $db->query and @cronus, spaces dont matter :p Quote
Z?v?? Posted March 5, 2007 Author Posted March 5, 2007 Re: Some Code Confusion??????? Ok, that worked deception, now its just not reading the outcomes like its supposed to. :? Quote
Vorlen Posted March 5, 2007 Posted March 5, 2007 Re: Some Code Confusion??????? Ok, that worked deception, now its just not reading the outcomes like its supposed to. :? PM Me what you have so far, and what it says and such, I can help you fix it. :) Quote
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.